package com.hrbxlh.util;

import java.io.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import jxl.Sheet;
import jxl.Workbook;
import net.coobird.thumbnailator.Thumbnails;
import org.apache.commons.io.FileUtils;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;


import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import sun.misc.BASE64Decoder;


/**
 * 公共方法
 * 作者：商莹
 * 日期：2017-1-13
 */
public class PubMethods {
	//课程色值集合
	private static String[] colorList = new String[]{"#4f87d9"," #ff7583","#b381d6","#779afe","#39c2b0","#6b76ac","#f8b44a","#5281c6"};
	//课程标志集合
	private static String[] markList = new String[]{"&#xe68a;", "&#xe64b;", "&#xe639;", "&#xe60c;", "&#xe603;", "&#xe702;", "&#xe602;", "&#xe600;", "&#xe60b;", "&#xe65f;", "&#xe629;", "&#xe6be;", "&#xe611;"};

	/**
	 * 创建当前时间
	 * 参数：时间、区分是要当前时间还是传过来的时间
	 */
	public static String getNowTime(Date date,int mark) {
		String nowtime = "";
		String str = "";
		if(mark==1){
			str = "yyyy-MM-dd HH:mm:ss";
		}if(mark==2){
			str = "yyyy-MM-dd";
		}
		if (date != null) {
			SimpleDateFormat sdf1 = new SimpleDateFormat(str);
			nowtime = sdf1.format(date);
		}
		return nowtime;
	}

	public static long getTimeSeconds(String str) throws ParseException {
		if(str==null||str.equals("")||str.equals("null 00:00:00")){
			return 0;
		}
		Calendar c = Calendar.getInstance();
		c.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(str));
//		System.out.println("时间转化后的毫秒数为：" + c.getTimeInMillis());
		return c.getTimeInMillis();
	}

	/***
	 * 毫秒数转换为日期
	 */

	public static Map<String,Object> getExpreTime(int overdueTime){
		Map<String,Object> returnMap = new HashMap<>();
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");//24小时制
		long time = System.currentTimeMillis()+24*overdueTime*60*60*1000;
		Date date2 = new Date();
		date2.setTime(time);
		String dateTime = simpleDateFormat.format(date2);
		returnMap.put("dateTime",dateTime);
		returnMap.put("time",time);
		return returnMap;
	}

	/***@description 从session里取值
	 * @param 数组
	 * @throws Exception
	 */
	public static Map<String, Object> getSessionValues(String[] keysArray, HttpServletRequest request) throws Exception {
		Map<String, Object> map = new HashMap<String, Object>();
		try {
			HttpSession session = request.getSession();
			for (int i = 0; i < keysArray.length; i++) {
				map.put(keysArray[i], (String) session.getAttribute(keysArray[i]));
			}
		} catch (Exception e) {
		}
		return map;
	}

	//判断文件夹是否存在，不存在则创建
	public static void mkdirFile(String url){
		File saveFile = new File(url);
		if (!saveFile.exists()) {
			String s = url.substring(0,url.lastIndexOf("/") + 1);
			File saveFileDir = new File(s);
			saveFileDir.mkdirs();
			saveFile = new File(url);
		}
	}

	//设置excel基本的样式设置
	public static HSSFCellStyle cssStyle(HSSFWorkbook workbook) {
		HSSFCellStyle style = workbook.createCellStyle();
		HSSFFont font = workbook.createFont();
		font.setFontHeight((short) 220);
		font.setFontName("宋体");
//		font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示
		style.setFont(font);
		return style;
	}

	//excel的反射方法
	public static String getFieldValueByName(String fieldName, Map<String, Object> map) {
		//fieldName:className,obj:map对象
		String value = "";
		try {
			value = String.valueOf(map.get(fieldName));
			return value;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return value;
	}

	//导出excel的具体操作设置
	public static void excelOut(String fileName, HttpServletResponse response, HSSFWorkbook workbook) throws IOException {
		fileName = new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + ".xls";
		response.setContentType("application/vnd.ms-excel");
		response.setHeader("Content-disposition", "attachment;filename=" + fileName);
		OutputStream outputStream = response.getOutputStream();
		workbook.write(outputStream);
		outputStream.flush();
		outputStream.close();
	}

	//判断手机号是否合法
	public static boolean isMobileNum(String telNum) {
		Pattern p = Pattern.compile("^((13[0-9])|(14[^4,\\D])|(15[^4,\\D])|(18[0-9])|(17[0-9]))\\d{8}$");
//	        "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17([0-9]))|(18[0-9]))\\\\d{8}$"
		Matcher m = p.matcher(telNum);
		return m.matches();
	}

	//去掉字符串指定字符
	public static String getCharStr(String str) {
		if (!str.equals("")) {
			int i = str.indexOf("、");
			str = str.substring(0, i) + str.substring(i + 1);
		}
		return str;
	}

	//导入试题获取有效行数
	public static int getNewRows(int rows, Sheet rs) {
		int newRow = 0;
		boolean a = false;
		for (int i = 1; i < rows; i++) {
			String Name = rs.getCell(2, i).getContents().trim();
			if (Name != null && Name != "") {
				a = true;
			} else {
				break;
			}
			if (a) {
				newRow = newRow + 1;
			}

		}
		return (newRow + 1);
	}

	//导入成绩获取有效行数
	public static int getSourceNewRows(int rows, Sheet rs) {
		int newRow = 0;
		boolean a = false;
		for (int i = 0; i < rows; i++) {
			String Name = rs.getCell(1, i).getContents().trim();
			if (Name != null && Name != "") {
				a = true;
			} else {
				break;
			}
			if (a) {
				newRow = newRow + 1;
			}

		}
		return newRow;
	}

	//导入学生人员获取有效行数
	public static int getMemNewRows(int rows, Sheet rs) {
		int newRow = 0;
		boolean a = false;
		for (int i = 5; i < rows; i++) {
			String Name = rs.getCell(1, i).getContents().trim();
			if (Name != null && Name != "") {
				a = true;
			} else {
				break;
			}
			if (a) {
				newRow = newRow + 1;
			}

		}
		return (newRow + 1);
	}

	//导入教师人员获取有效行数
	public static int getTeaMemNewRows(int rows, Sheet rs) {
		int newRow = 0;
		boolean a = false;
		for (int i = 2; i < rows; i++) {
			String name = rs.getCell(0, i).getContents().trim();
			String id = rs.getCell(1, i).getContents().trim();
			String sex = rs.getCell(2, i).getContents().trim();
			String depart = rs.getCell(3, i).getContents().trim();
			String pro = rs.getCell(4, i).getContents().trim();
			String tel = rs.getCell(5, i).getContents().trim();

			if ((id.equals("") || id == null) && (name.equals("") || name == null) && (sex.equals("") || sex == null) && (tel.equals("") || tel == null)
					&& (depart.equals("") || depart == null) && (pro.equals("") || pro == null)) {
				break;
			}
			newRow = newRow + 1;

		}
		return (newRow + 1);
	}

	//导入学生人员获取有效行数
	public static Map<String, Object> getStuMemNewRows(int rows, Sheet rs) {
		int newRow = 0;
		boolean flag = true;
		int row = 0;
		Map<String, Object> returnMap = new HashMap<String, Object>();
		for (int i = 2; i < rows; i++) {
			String id = rs.getCell(0, i).getContents().trim();
			String name = rs.getCell(1, i).getContents().trim();
			String sex = rs.getCell(2, i).getContents().trim();
			String tel = rs.getCell(0, i).getContents().trim();
			if ((id.equals("") || id == null) && (name.equals("") || name == null) && (sex.equals("") || sex == null) && (tel.equals("") || tel == null)) {
				flag = false;
				row = i;
				break;
			}
			newRow = newRow + 1;
		}
		returnMap.put("flag", flag);
		returnMap.put("newRow", newRow + 1);
		returnMap.put("i", row + 1);
		return returnMap;
	}

	//判断一个字符串是否是中文
	public static boolean isStrChinese(String str) {
		if (str == null) return false;
		for (char c : str.toCharArray()) {
			if (isChinese(c)) return true;// 有一个中文字符就返回
		}
		return false;
	}

	//导入成绩获取有效行数
	public static int getCourseNewRows(int rows, Sheet rs) {
		int newRow = 0;
		boolean a = false;
		for (int i = 0; i < rows; i++) {
			String Name = rs.getCell(1, i).getContents().trim();
			if (Name != null && Name != "") {
				a = true;
			} else {
				break;
			}
			if (a) {
				newRow = newRow + 1;
			}

		}
		return (newRow);
	}

	//判断一个字符是否是
	public static boolean isChinese(char c) {
		return c >= 0x4E00 && c <= 0x9FA5;// 根据字节码判断
	}

	//判断某字符结尾是否是以中文或英文括号 1选择 2判断 3填空 4简答
	public static Map<String, Object> isBrackets(Map<String, Object> questionMap) {
		boolean flag = false;
		String msg = "";
		Map<String, Object> returnMap = new HashMap<String, Object>();
		String str = String.valueOf(questionMap.get("questionName"));
		String optionMsg = String.valueOf(questionMap.get("optionMsg"));
		String ansquesContent = String.valueOf(questionMap.get("ansquesContent"));
		int type = Integer.parseInt(String.valueOf(questionMap.get("questionType")));
		String returnStr = "";
		switch (type) {
			case 1:
				returnStr = isStr(optionMsg);
				String arr[] = returnStr.split("#");
				if (arr.length >= 2) {
					flag = true;
				} else {
					msg = "的选项输入不正确，请按照正确提示输入选项";
				}
				break;
			case 2:
				if (ansquesContent.equals("T") || ansquesContent.equals("F")) {
					flag = true;
					break;
				} else {
					msg = "的答案输入不正确，请按照正确提示输入答案";
				}
				break;
			case 3:
				returnStr = isStr(str);
				if (returnStr.contains("(+)")) {
					returnStr = isStr(ansquesContent);
					String aaa[] = returnStr.split(",");
					if (aaa.length > 0) {
						flag = true;
					} else {
						msg = "题目的格式输入不正确，请按照正确提示输入";
					}
				} else {
					msg = "题目的格式输入不正确，请按照正确提示输入";
				}
				break;
			case 4:
				flag = true;
				break;
			case 5:
				returnStr = isStr(optionMsg);
				String arr1[] = returnStr.split("#");
				if (arr1.length >= 2) {
					flag = true;
					/*returnStr = isStr(ansquesContent);
					try {
						String arr2[] = returnStr.split(",");
						String  ansquesContentTwo = arr2[1];
					}catch (Exception e){
						flag = false;
						msg = "的答案输入不正确，请按照正确提示输入答案";
					}*/

				} else {
					msg = "的选项输入不正确，请按照正确提示输入选项";
				}
				break;
			default:
				flag = false;
				break;
		}
		returnMap.put("flag", flag);
		returnMap.put("msg", msg);
		return returnMap;
	}

	public static String isStr(String str) {
		if (str.contains("，")) {
			str = str.replace("，", ",");
		}
		if (str.contains("（") && str.contains("）")) {
			str = str.replace("（", "(");
			str = str.replace("）", ")");
		}
		return str;
	}

	//判断是否包含括号
	public static String isContailKh(String str) {
		if (str.endsWith("()")||str.endsWith("（）")) {
			str = str.replace("()", "（  ）");
			return str;
		}
		if (!str.endsWith("()")&&!str.endsWith("（）")) {
			str = str.concat("（  ）");
			return str;
		}
		return str;
	}

	public static void postMed(HttpServletResponse response, ObjectMapper mapper, Map<String, Object> resultMap) throws IOException {
		String reJsonStr = mapper.writeValueAsString(resultMap);
		response.setContentType("text/html;charset=UTF-8");
		PrintWriter write = response.getWriter();
		write.println(reJsonStr);
		write.flush();

	}

	/**
	 * xzx
	 *
	 * @description 随机出某个课程的展示编码值，与课程颜色值
	 */
	public static Map<String, Object> getColorAndMark() {
		Map<String, Object> returnMap = new HashMap<String, Object>();
		int colorPosition = new Random().nextInt(colorList.length) % (colorList.length) + 1;
		int markPosition = new Random().nextInt(markList.length) % (markList.length) + 1;
		returnMap.put("color", colorList[colorPosition - 1]);
		returnMap.put("mark", markList[markPosition - 1]);
		return returnMap;
	}

	/**
	 * 判断是否含有特殊字符
	 *
	 * @param str
	 * @return true为包含，false为不包含
	 */
	public static boolean isSpecialChar(String str) {
		String regEx = "[_`~@#$%^&*+=|\\[\\]<>/~@#￥%……&*——+|【】]";
//		String regEx = "[ _`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~！@#￥%……&*（）——+|{}【】‘；：”“’。，、？]|\n|\r|\t";
		//var myReg = /^[^@\/\'\\\"#$%&\^\*]+$/;
		Pattern p = Pattern.compile(regEx);
		Matcher m = p.matcher(str);
		return m.find();
	}

	/**
	 * 判断是否含有特殊字符（导入试题那用的因为里面包含（+））
	 *
	 * @param str
	 * @return true为包含，false为不包含
	 */
	public static boolean isQSTSpecialChar(String str) {
		//	String regEx = "[ _`~!@#$%^&*=|{}':;'\\[\\]<>/?~！@#￥%……&*——|{}【】‘；：”“’。、？]|\n|\r|\t";
		str = str.replaceAll(" ", "");
		String regEx = "[ `~!@$&|{}\\[\\]<>/~@￥……&|{}【】]|\n|\r|\t";
		Pattern p = Pattern.compile(regEx);
		Matcher m = p.matcher(str);
		return m.find();
	}

	//生成html文件
	/*public static Map<String,Object> htmlFile(String html,HttpServletRequest request,String teaId,String courseName){
		Map<String,Object> map = new HashMap<String,Object>();

		StringBuilder path=new StringBuilder();
		String filePath = request.getSession().getServletContext().getRealPath("/upload");
		path.append(filePath);//保存生成Html文件的目录
		String fileName = "";
		String fileName1 = "";
		File file1;
		String str=null;
		String newPath = "";
		Date todaytime=new Date();
		File file=new File(path.toString());
		String folder = "question";
		File[] files = file.listFiles();//得到根目录下的所有文件名目录

		for(int i=0;i < files.length;i++){

			if(files[i].isDirectory()){//判断是否为目录

				if(files[i].getName().equals(folder)){

					str=files[i].getName();

				}
			}
		}

		if(str==null){

			file1=new File(path.append("\\"+folder+"\\").toString());

			file1.mkdir();//如果str等于空.则在根目录下创建folder目录.

			System.out.println("1:"+path);

		}else{

			path.append("\\"+str+"\\");//如果str不为空,则用原目录
			System.out.println("2:"+path);
		}

//		   String content="this is my fisrt Html page.这是我第一个html页面<br>呵呵.......史来右.在灰在此呵呵.......史来右.在灰在此呵呵.......史来 右.在灰在此呵呵.......史来右.在灰在此呵呵.......史来右.在灰在此";
		fileName = courseName+teaId+".html";
		fileName1 = courseName+teaId+".doc";
		File file2 = new File(path.append(courseName+teaId+".html").toString());
		StringBuilder sb = new StringBuilder();
		try {
			file2.createNewFile();//创建文件
			sb.append("<html><head><title>Html Test</title></head><body>");
			sb.append(html);
			sb.append("</div>");
			sb.append("</body></html>");



			PrintStream printStream = new PrintStream(new FileOutputStream(file2));

			printStream.println(sb.toString());//将字符串写入文件

			newPath=path.toString().replace("\\", "/");

			System.out.println(newPath);
			map.put("fileName", fileName);
			map.put("fileName1", fileName1);

		} catch (IOException e) {
			e.printStackTrace();
		}
		System.out.println("kasjdf束带结发"+map);
		return map;
	}*/

	/*html转word
	 * */

	/*public static void htmlToWord2(String html,String htmlUrl,String docUrl) throws Exception {
		//将路径改为正确路径
		String newHtmlUrl = htmlUrl.replaceAll("/", " ").replaceAll(" " , "\\\\\\\\").replace("\\\\\\\\","\\\\");
		System.out.println("newHtmlUrl"+newHtmlUrl);
		String newDocUrl = docUrl.replaceAll("/", " ").replaceAll(" " , "\\\\\\\\").replace("\\\\\\\\","\\\\");
		System.out.println("newDocUrl"+newDocUrl);
		//拼一个标准的HTML格式文档
		InputStream bodyIs = new FileInputStream(newHtmlUrl);
		String body = getContent(bodyIs);
		String content = "<html><head><meta charset='GBK'></head><body>" + body + "</body></html>";
		InputStream is = new ByteArrayInputStream(content.getBytes("GBK"));
		OutputStream os = new FileOutputStream(newDocUrl);
		inputStreamToWord(is, os);
	}*/

	/**
	 * 把输入流里面的内容以UTF-8编码当文本取出。
	 * 不考虑异常，直接抛出
	 * @param ises
	 * @return
	 * @throws IOException
	 */
	/*private static String getContent(InputStream... ises) throws IOException {
		if (ises != null) {
			StringBuilder result = new StringBuilder();
			BufferedReader br;
			String line;
			for (InputStream is : ises) {
				br = new BufferedReader(new InputStreamReader(is, "GBK"));
				while ((line=br.readLine()) != null) {
					result.append(line);
				}
			}
			return result.toString();
		}
		return null;
	}*/

	/**
	 * 把is写入到对应的word输出流os中
	 * 不考虑异常的捕获，直接抛出
	 *
	 * @throws IOException
	 */
	/*private static void inputStreamToWord(InputStream is, OutputStream os) throws IOException {
		POIFSFileSystem fs = new POIFSFileSystem();
		//对应于org.apache.poi.hdf.extractor.WordDocument
		fs.createDocument(is, "WordDocument");
		fs.writeFilesystem(os);
		os.close();
		is.close();
	}*/
	public static void delTempFile(String fileName) {
		//将临时存到文件删除
		try {
			FileUpload fileUpload = new FileUpload();
			String[] keysArray = {"tomcatUrl", "project_name", "server_address"};
			Map<String, Object> urlmap = ConfigFileUtil.getFileMessage("UtilFile.properties", keysArray);
			String pathStr = (String) urlmap.get("tomcatUrl") + (String) urlmap.get("project_name") + "upload/";
			fileUpload.deleteFileOnly(pathStr, fileName);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	//计算考试剩余时间 param:endTime考试结束时间
	public static double surplusTime(String endTime){
		double mincha = 0;
		try {
			if(endTime!=null&&!endTime.equals("")&&!endTime.equals("null")){
				String starttime = PubMethods.getNowTime(new Date(),1);
				Calendar c = Calendar.getInstance();
				c.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(starttime));
				long starttimecount = c.getTimeInMillis();
				c.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(endTime));
				long endtimecount = c.getTimeInMillis();
				long chatime = endtimecount-starttimecount;
				mincha = ((chatime/1000)/60.0);
//				mincha = (int) Math.round(a);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return mincha;
	}

	//计算考试剩余时间(学生端获取试卷用的)
	public static double surplusTimeTwo(String starttime){
		double mincha = 0;
		try {
			if(starttime!=null&&!starttime.equals("")&&!starttime.equals("null")){
				String endtime = PubMethods.getNowTime(new Date(),1);
				Calendar c = Calendar.getInstance();
				c.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(starttime));
				long starttimecount = c.getTimeInMillis();
				c.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(endtime));
				long endtimecount = c.getTimeInMillis();
				long chatime = endtimecount-starttimecount;
				mincha = ((chatime/1000)/60.0);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return mincha;
	}


	//判断导入的模板是否正确
	public static Map<String,Object> isModel(List<String> list1,List<String> list2, Sheet rs){
		Map<String,Object> returnMap = new HashMap<String, Object>();
		try {
			if(!list1.containsAll(list2)){
				returnMap.put("list",null);
				returnMap.put("msg","导入模板异常，请重新上传");
            }
		} catch (Exception e) {
			e.printStackTrace();
		}
		return returnMap;
	}

	//从session里获取当前登陆人的id
	public static String loginId(HttpServletRequest request){
		Map<String, Object> sessionMap = new SessionValues().getSessionValues(new String[] {"stuorteaId"}, request, "userMsg");
		String stuorteaId = String.valueOf(sessionMap.get("stuorteaId"));
		return stuorteaId;
	}

	//更改文件名
	public static void updateFileNames(String url,List<Map<String,Object>> list){
		File file = new File(url);
		//判断文件目录是否存在，且是文件目录，非文件
		if(file.exists() && file.isDirectory()){
			File[] childFiles = file.listFiles();
			String path = file.getAbsolutePath();
			for(File childFile : childFiles){
				for (Map<String,Object> mapOne:list){
					String beforeName = String.valueOf(mapOne.get("beforefileName"));
					String newName = String.valueOf(mapOne.get("newfileName"));
					//如果是文件
					if(childFile.isFile()){
						String oldName = childFile.getName();
						if(beforeName.equals(oldName)){
							childFile.renameTo(new File(path + "\\" +  newName));
						}
					}
				}
			}
		}

	}

	/**
	 * 把is写入到对应的word输出流os中
	 * 不考虑异常的捕获，直接抛出
	 *
	 * @param is
	 * @param os
	 * @throws IOException
	 */
	public static void inputStreamToWord(InputStream is, OutputStream os) throws IOException {
		POIFSFileSystem fs = new POIFSFileSystem();
		//对应于org.apache.poi.hdf.extractor.WordDocument
		fs.createDocument(is, "WordDocument");
		fs.writeFilesystem(os);
		os.close();
		is.close();
	}

	//生成word
	public static void coverHtml(String str,String cssStr,String filpathWord,String htmlUrl){
		String head = "<!DOCTYPE html>" +
				"<html>" +
				"<head>" +
				"<meta charset=\"UTF-8\" />" +
				"<title></title>" +
				"</head>" +
				"<style>";
		String headTwo = "</style>"+
				"<body id=\"contentBox\">";

		String foot = "</body></html>";
		if(cssStr==null||cssStr.equals("null")){
			cssStr="";
		}
		String newStr = head+cssStr+headTwo+str+foot;
		try {
			File file = new File(htmlUrl);
			PrintStream ps = new PrintStream(new FileOutputStream(file));
			ps.println(newStr);
			ps.close();
			InputStream bodyIs = new FileInputStream(file);
			String body =getContent(bodyIs);
			//将html代码转换成word文件并保存到服务器上
			InputStream is = new ByteArrayInputStream(body.getBytes("UTF-8"));
			OutputStream os = new FileOutputStream(filpathWord);
			inputStreamToWord(is, os);
		}catch (Exception e){
			e.printStackTrace();
		}
	}

	/**
	 * 把输入流里面的内容以UTF-8编码当文本取出。
	 * 不考虑异常，直接抛出
	 * @param ises
	 * @return
	 * @throws IOException
	 */
	public static String getContent(InputStream... ises) throws IOException {
		if (ises != null) {
			StringBuilder result = new StringBuilder();
			BufferedReader br;
			String line;
			for (InputStream is : ises) {
				br = new BufferedReader(new InputStreamReader(is, "GBK"));
				while ((line=br.readLine()) != null) {
					result.append(line);
				}
			}
			return result.toString();
		}
		return null;
	}

	//去重
	public static List<Map<String,Object>> noRepeatList(List<Map<String, Object>> listAll){
		for  ( int  i  =   0 ; i  <  listAll.size()  -   1 ; i ++ )  {
			for  ( int  j  =  listAll.size()  -   1 ; j  >  i; j -- )  {
				if  (String.valueOf(listAll.get(j)).equals(String.valueOf(listAll.get(i))))  {
					//说明有重复数据
					listAll.remove(j);
				}
			}
		}
		return listAll;
	}

	//将字符串转换成毫秒数
	public static long secondTime(String time) throws ParseException {
		long starttimecount = 0;
		if(time!=null&&!time.equals("")&&!time.equals("null")){
			Calendar c = Calendar.getInstance();
			c.setTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(time));
			starttimecount = c.getTimeInMillis();
		}else{
			starttimecount=0;
		}
		return starttimecount;
	}

	//将毫秒数转换为时间
	public static String getTime(long time){
		Date date = new Date(time);
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return sdf.format(date);
	}


	//多选--判断是否答案正确 true不正确 false正确
	public static boolean isManyOptionTure(String str,String str1){
		//如果包含逗号
		str = str.replace(",","");
		str1 = str1.replace(",","");
		if(str==null||str.equals("")){
			return true;
		}
		if(str.length()!=str1.length()){
			return true;
		}
		//目标串中每个字符都包含在原串中

		int length = str.length();
		Map<Character,Integer> targetCount = new HashMap<Character,Integer>();
		for(int i =0;i<length;i++){
			char c = str1.charAt(i);
			//target中某个字符不在原串中，返回false
			int indexOfSource = str.indexOf(c);
			if(indexOfSource==-1){
				return true;
			}

			//统计该串在本串中的个数
			if(targetCount.get(c)==null){
				targetCount.put(c, 1);
			}else{
				Integer count = targetCount.get(c);
				targetCount.put(c, 1+count);
			}
		}

		//统计原串中各个字符的个数
		Map<Character,Integer> sourceCount = new HashMap<Character,Integer>();
		for(int i =0;i<length;i++){
			char c = str.charAt(i);
			if(sourceCount.get(c)==null){
				sourceCount.put(c, 1);
			}else{
				Integer count = sourceCount.get(c);
				sourceCount.put(c, 1+count);
			}
		}

		//目标串中每个字符个数跟原串中对应字符的个数一样
		for(Map.Entry<Character, Integer> entry:targetCount.entrySet()){
			Character key = entry.getKey();
			if(entry.getValue()!=sourceCount.get(key)){
				return true;
			}
		}
		return false;
	}

	//生成word
	public static void coverHtml(String str,String filpathWord){
		/*String head = "<!DOCTYPE html>" +
				"<html>" +
				"<head>" +
				"<meta charset=\"GBK\" />" +
				"<title></title>" +
				"</head>" +
				"<style>";
		String headTwo = "</style>"+
				"<body id=\"contentBox\">";

		String foot = "</body></html>";
		String newStr = head+cssStr+headTwo+str+foot;*/
		String newStr = str;
		try {
			//将html代码转换成word文件并保存到服务器上
			InputStream is = new ByteArrayInputStream(newStr.getBytes("GBK"));
			OutputStream os = new FileOutputStream(filpathWord);
			inputStreamToWord(is, os);
		}catch (Exception e){
			e.printStackTrace();
		}
	}
	//生成word
	public static void coverHtml(String str,String cssStr,String filpathWord){
		String head = "<!DOCTYPE html>" +
				"<html>" +
				"<head>" +
				"<meta charset=\"GBK\" />" +
				"<title></title>" +
				"</head>" +
				"<style>";
		String headTwo = "</style>"+
				"<body id=\"contentBox\">";

		String foot = "</body></html>";
		String newStr = head+cssStr+headTwo+str+foot;
		try {
			//将html代码转换成word文件并保存到服务器上
			InputStream is = new ByteArrayInputStream(newStr.getBytes("GBK"));
			OutputStream os = new FileOutputStream(filpathWord);
			inputStreamToWord(is, os);
		}catch (Exception e){
			e.printStackTrace();
		}
	}

	//生成html页
	public static void creatHtml(String html,String filePath,HttpServletRequest request){
		String head = "<!DOCTYPE html>" +
				"<html>" +
				"<head>" +
				"<meta charset=\"UTF-8\" />" +
				"<title></title>" +
				"</head>" +
				"<style>";
		String cssStr = "@charset \"UTF-8\";*{padding:0;margin:0;}*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,hr,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{margin:0;padding:0;}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}img{border:none;vertical-align:middle;}.editormd ul{list-style:unset;}.editormd ol{list-style:decimal;}.clear{*zoom:1;}.clear:before,.clear:after{height:0;content:\"\";font-size:0;display:table;line-height:0;visibility:hidden;}.clear:after{clear:both;}body{font-size:14px;color:#666;font-family:\"Microsoft YaHei\",\"微软雅黑\",Helvetica,Tahoma,STXihei,\"华文细黑\",STHeiti,\"Helvetica Neue\",Helvetica,Tahoma,\"Droid Sans\",\"wenquanyi micro hei\",FreeSans,Arimo,Arial,SimSun,\"宋体\",Heiti,\"黑体\",sans-serif;text-align:left;width:99%;margin-left:1%;}#layout{text-align:left;}#layout > header,.btns{padding:15px 0;width:90%;margin:0 auto;}.btns{padding-top:0;}.btns button{padding:2px 8px;}#layout > header > h1{font-size:20px;margin-bottom:10px;}.btns button,.btn{padding:8px 10px;background:#fff;border:1px solid #ddd;-webkit-border-radius:3px;border-radius:3px;cursor:pointer;-webkit-transition:background 300ms ease-out;transition:background 300ms ease-out;}.btns button:hover,.btn:hover{background:#f6f6f6;}.editormd{width:90%;height:640px;margin:0 auto;text-align:left;overflow:hidden;position:relative;margin-bottom:15px;border:1px solid #ddd;font-family:\"Meiryo UI\",\"Microsoft YaHei\",\"Malgun Gothic\",\"Segoe UI\",\"Trebuchet MS\",Helvetica,\"Monaco\",monospace,Tahoma,STXihei,\"华文细黑\",STHeiti,\"Helvetica Neue\",\"Droid Sans\",\"wenquanyi micro hei\",FreeSans,Arimo,Arial,SimSun,\"宋体\",Heiti,\"黑体\",sans-serif;}.editormd *,.editormd *:before,.editormd *:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}.editormd a{text-decoration:none;}.editormd img{border:none;vertical-align:middle;}.editormd > textarea,.editormd .editormd-html-textarea,.editormd .editormd-markdown-textarea{width:0;height:0;outline:0;resize:none;}.editormd .editormd-html-textarea,.editormd .editormd-markdown-textarea{display:none;}.editormd input[type=\"text\"],.editormd input[type=\"button\"],.editormd input[type=\"submit\"],.editormd select,.editormd textarea,.editormd button{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;}.editormd::-webkit-scrollbar{height:10px;width:7px;background:rgba(0,0,0,0.1);}.editormd::-webkit-scrollbar:hover{background:rgba(0,0,0,0.2);}.editormd::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.3);-webkit-border-radius:6px;-moz-border-radius:6px;-ms-border-radius:6px;-o-border-radius:6px;border-radius:6px;}.editormd::-webkit-scrollbar-thumb:hover{-webkit-box-shadow:inset 1px 1px 1px rgba(0,0,0,0.25);-moz-box-shadow:inset 1px 1px 1px rgba(0,0,0,0.25);-ms-box-shadow:inset 1px 1px 1px rgba(0,0,0,0.25);-o-box-shadow:inset 1px 1px 1px rgba(0,0,0,0.25);box-shadow:inset 1px 1px 1px rgba(0,0,0,0.25);background-color:rgba(0,0,0,0.4);}.editormd-user-unselect{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;}.editormd-toolbar{width:100%;min-height:37px;background:#fff;display:none;position:absolute;top:0;left:0;z-index:10;border-bottom:1px solid #ddd;}.editormd-toolbar-container{padding:0 8px;min-height:35px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;}.editormd-menu{margin:0;padding:0;list-style:none;}.editormd-menu > li{margin:0;padding:5px 1px;display:inline-block;position:relative;}.editormd-menu > li.divider{display:inline-block;text-indent:-9999px;margin:0 5px;height:65%;border-right:1px solid #ddd;}.editormd-menu > li > a{outline:0;color:#666;display:inline-block;min-width:24px;font-size:16px;text-decoration:none;text-align:center;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;border:1px solid #fff;-webkit-transition:all 300ms ease-out;-moz-transition:all 300ms ease-out;transition:all 300ms ease-out;}.editormd-menu > li > a:hover,.editormd-menu > li > a.active{border:1px solid #ddd;background:#eee;}.editormd-menu > li > a > .fa{text-align:center;display:block;padding:5px;}.editormd-menu > li > a > .editormd-bold{padding:5px 2px;display:inline-block;font-weight:bold;}.editormd-menu > li:hover .editormd-dropdown-menu{display:block;}.editormd-menu > li + li > a{margin-left:3px;}.editormd-dropdown-menu{display:none;background:#fff;border:1px solid #ddd;width:148px;list-style:none;position:absolute;top:33px;left:0;z-index:100;-webkit-box-shadow:1px 2px 6px rgba(0,0,0,0.15);-moz-box-shadow:1px 2px 6px rgba(0,0,0,0.15);-ms-box-shadow:1px 2px 6px rgba(0,0,0,0.15);-o-box-shadow:1px 2px 6px rgba(0,0,0,0.15);box-shadow:1px 2px 6px rgba(0,0,0,0.15);}.editormd-dropdown-menu:before,.editormd-dropdown-menu:after{width:0;height:0;display:block;content:\"\";position:absolute;top:-11px;left:8px;border:5px solid transparent;}.editormd-dropdown-menu:before{border-bottom-color:#ccc;}.editormd-dropdown-menu:after{border-bottom-color:#ffffff;top:-10px;}.editormd-dropdown-menu > li > a{color:#666;display:block;text-decoration:none;padding:8px 10px;}.editormd-dropdown-menu > li > a:hover{background:#f6f6f6;-webkit-transition:all 300ms ease-out;-moz-transition:all 300ms ease-out;transition:all 300ms ease-out;}.editormd-dropdown-menu > li + li{border-top:1px solid #ddd;}.editormd-container{margin:0;width:100%;height:100%;overflow:hidden;padding:35px 0 0;position:relative;background:#fff;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}.editormd-dialog{color:#666;position:fixed;z-index:99999;display:none;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 0 10px rgba(0,0,0,0.3);-moz-box-shadow:0 0 10px rgba(0,0,0,0.3);-ms-box-shadow:0 0 10px rgba(0,0,0,0.3);-o-box-shadow:0 0 10px rgba(0,0,0,0.3);box-shadow:0 0 10px rgba(0,0,0,0.3);background:#fff;font-size:14px;}.editormd-dialog-container{position:relative;padding:20px;line-height:1.4;}.editormd-dialog-container h1{font-size:24px;margin-bottom:10px;}.editormd-dialog-container h1 .fa{color:#2C7EEA;padding-right:5px;}.editormd-dialog-container h1 small{padding-left:5px;font-weight:normal;font-size:12px;color:#999;}.editormd-dialog-container select{color:#999;padding:3px 8px;border:1px solid #ddd;}.editormd-dialog-close{position:absolute;top:12px;right:15px;font-size:18px;color:#ccc;-webkit-transition:color 300ms ease-out;-moz-transition:color 300ms ease-out;transition:color 300ms ease-out;}.editormd-dialog-close:hover{color:#999;}.editormd-dialog-header{padding:11px 20px;border-bottom:1px solid #eee;-webkit-transition:background 300ms ease-out;-moz-transition:background 300ms ease-out;transition:background 300ms ease-out;}.editormd-dialog-header:hover{background:#f6f6f6;}.editormd-dialog-title{font-size:14px;}.editormd-dialog-footer{padding:10px 0 0 0;text-align:right;}.editormd-dialog-info{width:420px;}.editormd-dialog-info h1{font-weight:normal;}.editormd-dialog-info .editormd-dialog-container{padding:20px 25px 25px;}.editormd-dialog-info .editormd-dialog-close{top:10px;right:10px;}.editormd-dialog-info p > a,.editormd-dialog-info .hover-link:hover{color:#2196F3;}.editormd-dialog-info .hover-link{color:#666;}.editormd-dialog-info a .fa-external-link{display:none;}.editormd-dialog-info a:hover{color:#2196F3;}.editormd-dialog-info a:hover .fa-external-link{display:inline-block;}.editormd-mask,.editormd-container-mask,.editormd-dialog-mask{display:none;width:100%;height:100%;position:absolute;top:0;left:0;}.editormd-mask,.editormd-dialog-mask-bg{background:#fff;opacity:0.5;filter:alpha(opacity=50);}.editormd-mask{position:fixed;background:#000;opacity:0.2;filter:alpha(opacity=20);z-index:99998;}.editormd-container-mask,.editormd-dialog-mask-con{background:url(editormdfonts/loading.gif) no-repeat center center;-webkit-background-size:32px 32px;-moz-background-size:32px 32px;-o-background-size:32px 32px;background-size:32px 32px;}.editormd-container-mask{z-index:20;display:block;background-color:#fff;}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2){.editormd-container-mask,.editormd-dialog-mask-con{background-image:url(editormdfonts/loading@2x.gif);}}@media only screen and (-webkit-min-device-pixel-ratio:3),only screen and (min-device-pixel-ratio:3){.editormd-container-mask,.editormd-dialog-mask-con{background-image:url(editormdfonts/loading@3x.gif);}}.editormd-code-block-dialog textarea,.editormd-preformatted-text-dialog textarea{width:100%;height:400px;margin-bottom:6px;overflow:auto;border:1px solid #eee;background:#fff;padding:15px;resize:none;}.editormd-code-toolbar{color:#999;font-size:14px;margin:-5px 0 10px;}.editormd-grid-table{width:99%;display:table;border:1px solid #ddd;border-collapse:collapse;}.editormd-grid-table-row{width:100%;display:table-row;}.editormd-grid-table-row a{font-size:1.4em;width:5%;height:36px;color:#999;text-align:center;display:table-cell;vertical-align:middle;border:1px solid #ddd;text-decoration:none;-webkit-transition:background-color 300ms ease-out,color 100ms ease-in;-moz-transition:background-color 300ms ease-out,color 100ms ease-in;transition:background-color 300ms ease-out,color 100ms ease-in;}.editormd-grid-table-row a.selected{color:#666;background-color:#eee;}.editormd-grid-table-row a:hover{color:#777;background-color:#f6f6f6;}.editormd-tab-head{list-style:none;border-bottom:1px solid #ddd;}.editormd-tab-head li{display:inline-block;}.editormd-tab-head li a{color:#999;display:block;padding:6px 12px 5px;text-align:center;text-decoration:none;margin-bottom:-1px;border:1px solid #ddd;-webkit-border-top-left-radius:3px;-moz-border-top-left-radius:3px;-ms-border-top-left-radius:3px;-o-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-top-right-radius:3px;-moz-border-top-right-radius:3px;-ms-border-top-right-radius:3px;-o-border-top-right-radius:3px;border-top-right-radius:3px;background:#f6f6f6;-webkit-transition:all 300ms ease-out;-moz-transition:all 300ms ease-out;transition:all 300ms ease-out;}.editormd-tab-head li a:hover{color:#666;background:#eee;}.editormd-tab-head li.active a{color:#666;background:#fff;border-bottom-color:#fff;}.editormd-tab-head li + li{margin-left:3px;}.editormd-tab-box{padding:20px 0;}.editormd-form{color:#666;}.editormd-form label{float:left;display:block;width:75px;text-align:left;padding:7px 0 15px 5px;margin:0 0 2px;font-weight:normal;}.editormd-form br{clear:both;}.editormd-form iframe{display:none;}.editormd-form input:focus{outline:0;}.editormd-form input[type=\"text\"],.editormd-form input[type=\"number\"]{color:#999;padding:8px;border:1px solid #ddd;}.editormd-form input[type=\"number\"]{width:40px;display:inline-block;padding:6px 8px;}.editormd-form input[type=\"text\"]{display:inline-block;width:264px;}.editormd-form .fa-btns{display:inline-block;}.editormd-form .fa-btns a{color:#999;padding:7px 10px 0 0;display:inline-block;text-decoration:none;text-align:center;}.editormd-form .fa-btns .fa{font-size:1.3em;}.editormd-form .fa-btns label{float:none;display:inline-block;width:auto;text-align:left;padding:0 0 0 5px;cursor:pointer;}.editormd-form input[type=\"submit\"],.editormd-form .editormd-btn,.editormd-form button,.editormd-dialog-container input[type=\"submit\"],.editormd-dialog-container .editormd-btn,.editormd-dialog-container button,.editormd-dialog-footer input[type=\"submit\"],.editormd-dialog-footer .editormd-btn,.editormd-dialog-footer button{color:#666;min-width:75px;cursor:pointer;background:#fff;padding:7px 10px;border:1px solid #ddd;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;-webkit-transition:background 300ms ease-out;-moz-transition:background 300ms ease-out;transition:background 300ms ease-out;}.editormd-form input[type=\"submit\"]:hover,.editormd-form .editormd-btn:hover,.editormd-form button:hover,.editormd-dialog-container input[type=\"submit\"]:hover,.editormd-dialog-container .editormd-btn:hover,.editormd-dialog-container button:hover,.editormd-dialog-footer input[type=\"submit\"]:hover,.editormd-dialog-footer .editormd-btn:hover,.editormd-dialog-footer button:hover{background:#eee;}.editormd-form .editormd-btn,.editormd-dialog-container .editormd-btn,.editormd-dialog-footer .editormd-btn{padding:5px 8px 4px\\0;}.editormd-form .editormd-btn + .editormd-btn,.editormd-dialog-container .editormd-btn + .editormd-btn,.editormd-dialog-footer .editormd-btn + .editormd-btn{margin-left:8px;}.editormd-file-input{width:75px;height:32px;margin-left:8px;position:relative;display:inline-block;}.editormd-file-input input[type=\"file\"]{width:75px;height:32px;opacity:0;cursor:pointer;background:#000;display:inline-block;position:absolute;top:0;right:0;}.editormd-file-input input[type=\"file\"]::-webkit-file-upload-button{visibility:hidden;}.editormd-file-input:hover input[type=\"submit\"]{background:#eee;}.editormd .CodeMirror,.editormd-preview{display:inline-block;width:50%;height:100%;vertical-align:top;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;}.editormd-preview{position:absolute;top:35px;right:0;right:-1px\\0;overflow:auto;line-height:1.6;display:none;background:#fff;}.editormd .CodeMirror{z-index:10;float:left;border-right:1px solid #ddd;font-size:14px;font-family:\"YaHei Consolas Hybrid\",Consolas,\"微软雅黑\",\"Meiryo UI\",\"Malgun Gothic\",\"Segoe UI\",\"Trebuchet MS\",Helvetica,\"Monaco\",courier,monospace;line-height:1.6;margin-top:35px;}.editormd .CodeMirror pre{font-size:14px;padding:0 12px;}.editormd .CodeMirror-linenumbers{padding:0 5px;}.editormd .CodeMirror-selected{background:#70B7FF;}.editormd .CodeMirror-focused .CodeMirror-selected{background:#70B7FF;}.editormd .CodeMirror,.editormd .CodeMirror-scroll,.editormd .editormd-preview{-webkit-overflow-scrolling:touch;}.editormd .styled-background{background-color:#ff7;}.editormd .CodeMirror-focused .cm-matchhighlight{background-image:url();background-position:bottom;background-repeat:repeat-x;}.editormd .CodeMirror-empty.CodeMirror-focused{outline:none;}.editormd .CodeMirror pre.CodeMirror-placeholder{color:#999;}.editormd .cm-trailingspace{background-image:url();background-position:bottom left;background-repeat:repeat-x;}.editormd .cm-tab{background:url();background-position:right;background-repeat:no-repeat;}@font-face{font-family:'FontAwesome';src:url(\"editormdfonts/fontawesome-webfont.eot?v=4.3.0\");src:url(\"editormdfonts/fontawesome-webfont.eot?#iefix&v=4.3.0\") format(\"embedded-opentype\"),url(\"editormdfonts/fontawesome-webfont.woff2?v=4.3.0\") format(\"woff2\"),url(\"editormdfonts/fontawesome-webfont.woff?v=4.3.0\") format(\"woff\"),url(\"editormdfonts/fontawesome-webfont.ttf?v=4.3.0\") format(\"truetype\"),url(\"editormdfonts/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular\") format(\"svg\");font-weight:normal;font-style:normal;}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;transform:translate(0,0);}.fa-lg{font-size:1.33333333em;line-height:0.75em;vertical-align:-15%;}.fa-2x{font-size:2em;}.fa-3x{font-size:3em;}.fa-4x{font-size:4em;}.fa-5x{font-size:5em;}.fa-fw{width:1.28571429em;text-align:center;}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none;}.fa-ul > li{position:relative;}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:0.14285714em;text-align:center;}.fa-li.fa-lg{left:-1.85714286em;}.fa-border{padding:.2em .25em .15em;border:solid 0.08em #eeeeee;border-radius:.1em;}.pull-right{float:right;}.pull-left{float:left;}.fa.pull-left{margin-right:.3em;}.fa.pull-right{margin-left:.3em;}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear;}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8);}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg);}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg);}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg);}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0,mirror=1);-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1);}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2,mirror=1);-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1);}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none;}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle;}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center;}.fa-stack-1x{line-height:inherit;}.fa-stack-2x{font-size:2em;}.fa-inverse{color:#ffffff;}.fa-glass:before{content:\"\\f000\";}.fa-music:before{content:\"\\f001\";}.fa-search:before{content:\"\\f002\";}.fa-envelope-o:before{content:\"\\f003\";}.fa-heart:before{content:\"\\f004\";}.fa-star:before{content:\"\\f005\";}.fa-star-o:before{content:\"\\f006\";}.fa-user:before{content:\"\\f007\";}.fa-film:before{content:\"\\f008\";}.fa-th-large:before{content:\"\\f009\";}.fa-th:before{content:\"\\f00a\";}.fa-th-list:before{content:\"\\f00b\";}.fa-check:before{content:\"\\f00c\";}.fa-remove:before,.fa-close:before,.fa-times:before{content:\"\\f00d\";}.fa-search-plus:before{content:\"\\f00e\";}.fa-search-minus:before{content:\"\\f010\";}.fa-power-off:before{content:\"\\f011\";}.fa-signal:before{content:\"\\f012\";}.fa-gear:before,.fa-cog:before{content:\"\\f013\";}.fa-trash-o:before{content:\"\\f014\";}.fa-home:before{content:\"\\f015\";}.fa-file-o:before{content:\"\\f016\";}.fa-clock-o:before{content:\"\\f017\";}.fa-road:before{content:\"\\f018\";}.fa-download:before{content:\"\\f019\";}.fa-arrow-circle-o-down:before{content:\"\\f01a\";}.fa-arrow-circle-o-up:before{content:\"\\f01b\";}.fa-inbox:before{content:\"\\f01c\";}.fa-play-circle-o:before{content:\"\\f01d\";}.fa-rotate-right:before,.fa-repeat:before{content:\"\\f01e\";}.fa-refresh:before{content:\"\\f021\";}.fa-list-alt:before{content:\"\\f022\";}.fa-lock:before{content:\"\\f023\";}.fa-flag:before{content:\"\\f024\";}.fa-headphones:before{content:\"\\f025\";}.fa-volume-off:before{content:\"\\f026\";}.fa-volume-down:before{content:\"\\f027\";}.fa-volume-up:before{content:\"\\f028\";}.fa-qrcode:before{content:\"\\f029\";}.fa-barcode:before{content:\"\\f02a\";}.fa-tag:before{content:\"\\f02b\";}.fa-tags:before{content:\"\\f02c\";}.fa-book:before{content:\"\\f02d\";}.fa-bookmark:before{content:\"\\f02e\";}.fa-print:before{content:\"\\f02f\";}.fa-camera:before{content:\"\\f030\";}.fa-font:before{content:\"\\f031\";}.fa-bold:before{content:\"\\f032\";}.fa-italic:before{content:\"\\f033\";}.fa-text-height:before{content:\"\\f034\";}.fa-text-width:before{content:\"\\f035\";}.fa-align-left:before{content:\"\\f036\";}.fa-align-center:before{content:\"\\f037\";}.fa-align-right:before{content:\"\\f038\";}.fa-align-justify:before{content:\"\\f039\";}.fa-list:before{content:\"\\f03a\";}.fa-dedent:before,.fa-outdent:before{content:\"\\f03b\";}.fa-indent:before{content:\"\\f03c\";}.fa-video-camera:before{content:\"\\f03d\";}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:\"\\f03e\";}.fa-pencil:before{content:\"\\f040\";}.fa-map-marker:before{content:\"\\f041\";}.fa-adjust:before{content:\"\\f042\";}.fa-tint:before{content:\"\\f043\";}.fa-edit:before,.fa-pencil-square-o:before{content:\"\\f044\";}.fa-share-square-o:before{content:\"\\f045\";}.fa-check-square-o:before{content:\"\\f046\";}.fa-arrows:before{content:\"\\f047\";}.fa-step-backward:before{content:\"\\f048\";}.fa-fast-backward:before{content:\"\\f049\";}.fa-backward:before{content:\"\\f04a\";}.fa-play:before{content:\"\\f04b\";}.fa-pause:before{content:\"\\f04c\";}.fa-stop:before{content:\"\\f04d\";}.fa-forward:before{content:\"\\f04e\";}.fa-fast-forward:before{content:\"\\f050\";}.fa-step-forward:before{content:\"\\f051\";}.fa-eject:before{content:\"\\f052\";}.fa-chevron-left:before{content:\"\\f053\";}.fa-chevron-right:before{content:\"\\f054\";}.fa-plus-circle:before{content:\"\\f055\";}.fa-minus-circle:before{content:\"\\f056\";}.fa-times-circle:before{content:\"\\f057\";}.fa-check-circle:before{content:\"\\f058\";}.fa-question-circle:before{content:\"\\f059\";}.fa-info-circle:before{content:\"\\f05a\";}.fa-crosshairs:before{content:\"\\f05b\";}.fa-times-circle-o:before{content:\"\\f05c\";}.fa-check-circle-o:before{content:\"\\f05d\";}.fa-ban:before{content:\"\\f05e\";}.fa-arrow-left:before{content:\"\\f060\";}.fa-arrow-right:before{content:\"\\f061\";}.fa-arrow-up:before{content:\"\\f062\";}.fa-arrow-down:before{content:\"\\f063\";}.fa-mail-forward:before,.fa-share:before{content:\"\\f064\";}.fa-expand:before{content:\"\\f065\";}.fa-compress:before{content:\"\\f066\";}.fa-plus:before{content:\"\\f067\";}.fa-minus:before{content:\"\\f068\";}.fa-asterisk:before{content:\"\\f069\";}.fa-exclamation-circle:before{content:\"\\f06a\";}.fa-gift:before{content:\"\\f06b\";}.fa-leaf:before{content:\"\\f06c\";}.fa-fire:before{content:\"\\f06d\";}.fa-eye:before{content:\"\\f06e\";}.fa-eye-slash:before{content:\"\\f070\";}.fa-warning:before,.fa-exclamation-triangle:before{content:\"\\f071\";}.fa-plane:before{content:\"\\f072\";}.fa-calendar:before{content:\"\\f073\";}.fa-random:before{content:\"\\f074\";}.fa-comment:before{content:\"\\f075\";}.fa-magnet:before{content:\"\\f076\";}.fa-chevron-up:before{content:\"\\f077\";}.fa-chevron-down:before{content:\"\\f078\";}.fa-retweet:before{content:\"\\f079\";}.fa-shopping-cart:before{content:\"\\f07a\";}.fa-folder:before{content:\"\\f07b\";}.fa-folder-open:before{content:\"\\f07c\";}.fa-arrows-v:before{content:\"\\f07d\";}.fa-arrows-h:before{content:\"\\f07e\";}.fa-bar-chart-o:before,.fa-bar-chart:before{content:\"\\f080\";}.fa-twitter-square:before{content:\"\\f081\";}.fa-facebook-square:before{content:\"\\f082\";}.fa-camera-retro:before{content:\"\\f083\";}.fa-key:before{content:\"\\f084\";}.fa-gears:before,.fa-cogs:before{content:\"\\f085\";}.fa-comments:before{content:\"\\f086\";}.fa-thumbs-o-up:before{content:\"\\f087\";}.fa-thumbs-o-down:before{content:\"\\f088\";}.fa-star-half:before{content:\"\\f089\";}.fa-heart-o:before{content:\"\\f08a\";}.fa-sign-out:before{content:\"\\f08b\";}.fa-linkedin-square:before{content:\"\\f08c\";}.fa-thumb-tack:before{content:\"\\f08d\";}.fa-external-link:before{content:\"\\f08e\";}.fa-sign-in:before{content:\"\\f090\";}.fa-trophy:before{content:\"\\f091\";}.fa-github-square:before{content:\"\\f092\";}.fa-upload:before{content:\"\\f093\";}.fa-lemon-o:before{content:\"\\f094\";}.fa-phone:before{content:\"\\f095\";}.fa-square-o:before{content:\"\\f096\";}.fa-bookmark-o:before{content:\"\\f097\";}.fa-phone-square:before{content:\"\\f098\";}.fa-twitter:before{content:\"\\f099\";}.fa-facebook-f:before,.fa-facebook:before{content:\"\\f09a\";}.fa-github:before{content:\"\\f09b\";}.fa-unlock:before{content:\"\\f09c\";}.fa-credit-card:before{content:\"\\f09d\";}.fa-rss:before{content:\"\\f09e\";}.fa-hdd-o:before{content:\"\\f0a0\";}.fa-bullhorn:before{content:\"\\f0a1\";}.fa-bell:before{content:\"\\f0f3\";}.fa-certificate:before{content:\"\\f0a3\";}.fa-hand-o-right:before{content:\"\\f0a4\";}.fa-hand-o-left:before{content:\"\\f0a5\";}.fa-hand-o-up:before{content:\"\\f0a6\";}.fa-hand-o-down:before{content:\"\\f0a7\";}.fa-arrow-circle-left:before{content:\"\\f0a8\";}.fa-arrow-circle-right:before{content:\"\\f0a9\";}.fa-arrow-circle-up:before{content:\"\\f0aa\";}.fa-arrow-circle-down:before{content:\"\\f0ab\";}.fa-globe:before{content:\"\\f0ac\";}.fa-wrench:before{content:\"\\f0ad\";}.fa-tasks:before{content:\"\\f0ae\";}.fa-filter:before{content:\"\\f0b0\";}.fa-briefcase:before{content:\"\\f0b1\";}.fa-arrows-alt:before{content:\"\\f0b2\";}.fa-group:before,.fa-users:before{content:\"\\f0c0\";}.fa-chain:before,.fa-link:before{content:\"\\f0c1\";}.fa-cloud:before{content:\"\\f0c2\";}.fa-flask:before{content:\"\\f0c3\";}.fa-cut:before,.fa-scissors:before{content:\"\\f0c4\";}.fa-copy:before,.fa-files-o:before{content:\"\\f0c5\";}.fa-paperclip:before{content:\"\\f0c6\";}.fa-save:before,.fa-floppy-o:before{content:\"\\f0c7\";}.fa-square:before{content:\"\\f0c8\";}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:\"\\f0c9\";}.fa-list-ul:before{content:\"\\f0ca\";}.fa-list-ol:before{content:\"\\f0cb\";}.fa-strikethrough:before{content:\"\\f0cc\";}.fa-underline:before{content:\"\\f0cd\";}.fa-table:before{content:\"\\f0ce\";}.fa-magic:before{content:\"\\f0d0\";}.fa-truck:before{content:\"\\f0d1\";}.fa-pinterest:before{content:\"\\f0d2\";}.fa-pinterest-square:before{content:\"\\f0d3\";}.fa-google-plus-square:before{content:\"\\f0d4\";}.fa-google-plus:before{content:\"\\f0d5\";}.fa-money:before{content:\"\\f0d6\";}.fa-caret-down:before{content:\"\\f0d7\";}.fa-caret-up:before{content:\"\\f0d8\";}.fa-caret-left:before{content:\"\\f0d9\";}.fa-caret-right:before{content:\"\\f0da\";}.fa-columns:before{content:\"\\f0db\";}.fa-unsorted:before,.fa-sort:before{content:\"\\f0dc\";}.fa-sort-down:before,.fa-sort-desc:before{content:\"\\f0dd\";}.fa-sort-up:before,.fa-sort-asc:before{content:\"\\f0de\";}.fa-envelope:before{content:\"\\f0e0\";}.fa-linkedin:before{content:\"\\f0e1\";}.fa-rotate-left:before,.fa-undo:before{content:\"\\f0e2\";}.fa-legal:before,.fa-gavel:before{content:\"\\f0e3\";}.fa-dashboard:before,.fa-tachometer:before{content:\"\\f0e4\";}.fa-comment-o:before{content:\"\\f0e5\";}.fa-comments-o:before{content:\"\\f0e6\";}.fa-flash:before,.fa-bolt:before{content:\"\\f0e7\";}.fa-sitemap:before{content:\"\\f0e8\";}.fa-umbrella:before{content:\"\\f0e9\";}.fa-paste:before,.fa-clipboard:before{content:\"\\f0ea\";}.fa-lightbulb-o:before{content:\"\\f0eb\";}.fa-exchange:before{content:\"\\f0ec\";}.fa-cloud-download:before{content:\"\\f0ed\";}.fa-cloud-upload:before{content:\"\\f0ee\";}.fa-user-md:before{content:\"\\f0f0\";}.fa-stethoscope:before{content:\"\\f0f1\";}.fa-suitcase:before{content:\"\\f0f2\";}.fa-bell-o:before{content:\"\\f0a2\";}.fa-coffee:before{content:\"\\f0f4\";}.fa-cutlery:before{content:\"\\f0f5\";}.fa-file-text-o:before{content:\"\\f0f6\";}.fa-building-o:before{content:\"\\f0f7\";}.fa-hospital-o:before{content:\"\\f0f8\";}.fa-ambulance:before{content:\"\\f0f9\";}.fa-medkit:before{content:\"\\f0fa\";}.fa-fighter-jet:before{content:\"\\f0fb\";}.fa-beer:before{content:\"\\f0fc\";}.fa-h-square:before{content:\"\\f0fd\";}.fa-plus-square:before{content:\"\\f0fe\";}.fa-angle-double-left:before{content:\"\\f100\";}.fa-angle-double-right:before{content:\"\\f101\";}.fa-angle-double-up:before{content:\"\\f102\";}.fa-angle-double-down:before{content:\"\\f103\";}.fa-angle-left:before{content:\"\\f104\";}.fa-angle-right:before{content:\"\\f105\";}.fa-angle-up:before{content:\"\\f106\";}.fa-angle-down:before{content:\"\\f107\";}.fa-desktop:before{content:\"\\f108\";}.fa-laptop:before{content:\"\\f109\";}.fa-tablet:before{content:\"\\f10a\";}.fa-mobile-phone:before,.fa-mobile:before{content:\"\\f10b\";}.fa-circle-o:before{content:\"\\f10c\";}.fa-quote-left:before{content:\"\\f10d\";}.fa-quote-right:before{content:\"\\f10e\";}.fa-spinner:before{content:\"\\f110\";}.fa-circle:before{content:\"\\f111\";}.fa-mail-reply:before,.fa-reply:before{content:\"\\f112\";}.fa-github-alt:before{content:\"\\f113\";}.fa-folder-o:before{content:\"\\f114\";}.fa-folder-open-o:before{content:\"\\f115\";}.fa-smile-o:before{content:\"\\f118\";}.fa-frown-o:before{content:\"\\f119\";}.fa-meh-o:before{content:\"\\f11a\";}.fa-gamepad:before{content:\"\\f11b\";}.fa-keyboard-o:before{content:\"\\f11c\";}.fa-flag-o:before{content:\"\\f11d\";}.fa-flag-checkered:before{content:\"\\f11e\";}.fa-terminal:before{content:\"\\f120\";}.fa-code:before{content:\"\\f121\";}.fa-mail-reply-all:before,.fa-reply-all:before{content:\"\\f122\";}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:\"\\f123\";}.fa-location-arrow:before{content:\"\\f124\";}.fa-crop:before{content:\"\\f125\";}.fa-code-fork:before{content:\"\\f126\";}.fa-unlink:before,.fa-chain-broken:before{content:\"\\f127\";}.fa-question:before{content:\"\\f128\";}.fa-info:before{content:\"\\f129\";}.fa-exclamation:before{content:\"\\f12a\";}.fa-superscript:before{content:\"\\f12b\";}.fa-subscript:before{content:\"\\f12c\";}.fa-eraser:before{content:\"\\f12d\";}.fa-puzzle-piece:before{content:\"\\f12e\";}.fa-microphone:before{content:\"\\f130\";}.fa-microphone-slash:before{content:\"\\f131\";}.fa-shield:before{content:\"\\f132\";}.fa-calendar-o:before{content:\"\\f133\";}.fa-fire-extinguisher:before{content:\"\\f134\";}.fa-rocket:before{content:\"\\f135\";}.fa-maxcdn:before{content:\"\\f136\";}.fa-chevron-circle-left:before{content:\"\\f137\";}.fa-chevron-circle-right:before{content:\"\\f138\";}.fa-chevron-circle-up:before{content:\"\\f139\";}.fa-chevron-circle-down:before{content:\"\\f13a\";}.fa-html5:before{content:\"\\f13b\";}.fa-css3:before{content:\"\\f13c\";}.fa-anchor:before{content:\"\\f13d\";}.fa-unlock-alt:before{content:\"\\f13e\";}.fa-bullseye:before{content:\"\\f140\";}.fa-ellipsis-h:before{content:\"\\f141\";}.fa-ellipsis-v:before{content:\"\\f142\";}.fa-rss-square:before{content:\"\\f143\";}.fa-play-circle:before{content:\"\\f144\";}.fa-ticket:before{content:\"\\f145\";}.fa-minus-square:before{content:\"\\f146\";}.fa-minus-square-o:before{content:\"\\f147\";}.fa-level-up:before{content:\"\\f148\";}.fa-level-down:before{content:\"\\f149\";}.fa-check-square:before{content:\"\\f14a\";}.fa-pencil-square:before{content:\"\\f14b\";}.fa-external-link-square:before{content:\"\\f14c\";}.fa-share-square:before{content:\"\\f14d\";}.fa-compass:before{content:\"\\f14e\";}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:\"\\f150\";}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:\"\\f151\";}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:\"\\f152\";}.fa-euro:before,.fa-eur:before{content:\"\\f153\";}.fa-gbp:before{content:\"\\f154\";}.fa-dollar:before,.fa-usd:before{content:\"\\f155\";}.fa-rupee:before,.fa-inr:before{content:\"\\f156\";}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:\"\\f157\";}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:\"\\f158\";}.fa-won:before,.fa-krw:before{content:\"\\f159\";}.fa-bitcoin:before,.fa-btc:before{content:\"\\f15a\";}.fa-file:before{content:\"\\f15b\";}.fa-file-text:before{content:\"\\f15c\";}.fa-sort-alpha-asc:before{content:\"\\f15d\";}.fa-sort-alpha-desc:before{content:\"\\f15e\";}.fa-sort-amount-asc:before{content:\"\\f160\";}.fa-sort-amount-desc:before{content:\"\\f161\";}.fa-sort-numeric-asc:before{content:\"\\f162\";}.fa-sort-numeric-desc:before{content:\"\\f163\";}.fa-thumbs-up:before{content:\"\\f164\";}.fa-thumbs-down:before{content:\"\\f165\";}.fa-youtube-square:before{content:\"\\f166\";}.fa-youtube:before{content:\"\\f167\";}.fa-xing:before{content:\"\\f168\";}.fa-xing-square:before{content:\"\\f169\";}.fa-youtube-play:before{content:\"\\f16a\";}.fa-dropbox:before{content:\"\\f16b\";}.fa-stack-overflow:before{content:\"\\f16c\";}.fa-instagram:before{content:\"\\f16d\";}.fa-flickr:before{content:\"\\f16e\";}.fa-adn:before{content:\"\\f170\";}.fa-bitbucket:before{content:\"\\f171\";}.fa-bitbucket-square:before{content:\"\\f172\";}.fa-tumblr:before{content:\"\\f173\";}.fa-tumblr-square:before{content:\"\\f174\";}.fa-long-arrow-down:before{content:\"\\f175\";}.fa-long-arrow-up:before{content:\"\\f176\";}.fa-long-arrow-left:before{content:\"\\f177\";}.fa-long-arrow-right:before{content:\"\\f178\";}.fa-apple:before{content:\"\\f179\";}.fa-windows:before{content:\"\\f17a\";}.fa-android:before{content:\"\\f17b\";}.fa-linux:before{content:\"\\f17c\";}.fa-dribbble:before{content:\"\\f17d\";}.fa-skype:before{content:\"\\f17e\";}.fa-foursquare:before{content:\"\\f180\";}.fa-trello:before{content:\"\\f181\";}.fa-female:before{content:\"\\f182\";}.fa-male:before{content:\"\\f183\";}.fa-gittip:before,.fa-gratipay:before{content:\"\\f184\";}.fa-sun-o:before{content:\"\\f185\";}.fa-moon-o:before{content:\"\\f186\";}.fa-archive:before{content:\"\\f187\";}.fa-bug:before{content:\"\\f188\";}.fa-vk:before{content:\"\\f189\";}.fa-weibo:before{content:\"\\f18a\";}.fa-renren:before{content:\"\\f18b\";}.fa-pagelines:before{content:\"\\f18c\";}.fa-stack-exchange:before{content:\"\\f18d\";}.fa-arrow-circle-o-right:before{content:\"\\f18e\";}.fa-arrow-circle-o-left:before{content:\"\\f190\";}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:\"\\f191\";}.fa-dot-circle-o:before{content:\"\\f192\";}.fa-wheelchair:before{content:\"\\f193\";}.fa-vimeo-square:before{content:\"\\f194\";}.fa-turkish-lira:before,.fa-try:before{content:\"\\f195\";}.fa-plus-square-o:before{content:\"\\f196\";}.fa-space-shuttle:before{content:\"\\f197\";}.fa-slack:before{content:\"\\f198\";}.fa-envelope-square:before{content:\"\\f199\";}.fa-wordpress:before{content:\"\\f19a\";}.fa-openid:before{content:\"\\f19b\";}.fa-institution:before,.fa-bank:before,.fa-university:before{content:\"\\f19c\";}.fa-mortar-board:before,.fa-graduation-cap:before{content:\"\\f19d\";}.fa-yahoo:before{content:\"\\f19e\";}.fa-google:before{content:\"\\f1a0\";}.fa-reddit:before{content:\"\\f1a1\";}.fa-reddit-square:before{content:\"\\f1a2\";}.fa-stumbleupon-circle:before{content:\"\\f1a3\";}.fa-stumbleupon:before{content:\"\\f1a4\";}.fa-delicious:before{content:\"\\f1a5\";}.fa-digg:before{content:\"\\f1a6\";}.fa-pied-piper:before{content:\"\\f1a7\";}.fa-pied-piper-alt:before{content:\"\\f1a8\";}.fa-drupal:before{content:\"\\f1a9\";}.fa-joomla:before{content:\"\\f1aa\";}.fa-language:before{content:\"\\f1ab\";}.fa-fax:before{content:\"\\f1ac\";}.fa-building:before{content:\"\\f1ad\";}.fa-child:before{content:\"\\f1ae\";}.fa-paw:before{content:\"\\f1b0\";}.fa-spoon:before{content:\"\\f1b1\";}.fa-cube:before{content:\"\\f1b2\";}.fa-cubes:before{content:\"\\f1b3\";}.fa-behance:before{content:\"\\f1b4\";}.fa-behance-square:before{content:\"\\f1b5\";}.fa-steam:before{content:\"\\f1b6\";}.fa-steam-square:before{content:\"\\f1b7\";}.fa-recycle:before{content:\"\\f1b8\";}.fa-automobile:before,.fa-car:before{content:\"\\f1b9\";}.fa-cab:before,.fa-taxi:before{content:\"\\f1ba\";}.fa-tree:before{content:\"\\f1bb\";}.fa-spotify:before{content:\"\\f1bc\";}.fa-deviantart:before{content:\"\\f1bd\";}.fa-soundcloud:before{content:\"\\f1be\";}.fa-database:before{content:\"\\f1c0\";}.fa-file-pdf-o:before{content:\"\\f1c1\";}.fa-file-word-o:before{content:\"\\f1c2\";}.fa-file-excel-o:before{content:\"\\f1c3\";}.fa-file-powerpoint-o:before{content:\"\\f1c4\";}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:\"\\f1c5\";}.fa-file-zip-o:before,.fa-file-archive-o:before{content:\"\\f1c6\";}.fa-file-sound-o:before,.fa-file-audio-o:before{content:\"\\f1c7\";}.fa-file-movie-o:before,.fa-file-video-o:before{content:\"\\f1c8\";}.fa-file-code-o:before{content:\"\\f1c9\";}.fa-vine:before{content:\"\\f1ca\";}.fa-codepen:before{content:\"\\f1cb\";}.fa-jsfiddle:before{content:\"\\f1cc\";}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:\"\\f1cd\";}.fa-circle-o-notch:before{content:\"\\f1ce\";}.fa-ra:before,.fa-rebel:before{content:\"\\f1d0\";}.fa-ge:before,.fa-empire:before{content:\"\\f1d1\";}.fa-git-square:before{content:\"\\f1d2\";}.fa-git:before{content:\"\\f1d3\";}.fa-hacker-news:before{content:\"\\f1d4\";}.fa-tencent-weibo:before{content:\"\\f1d5\";}.fa-qq:before{content:\"\\f1d6\";}.fa-wechat:before,.fa-weixin:before{content:\"\\f1d7\";}.fa-send:before,.fa-paper-plane:before{content:\"\\f1d8\";}.fa-send-o:before,.fa-paper-plane-o:before{content:\"\\f1d9\";}.fa-history:before{content:\"\\f1da\";}.fa-genderless:before,.fa-circle-thin:before{content:\"\\f1db\";}.fa-header:before{content:\"\\f1dc\";}.fa-paragraph:before{content:\"\\f1dd\";}.fa-sliders:before{content:\"\\f1de\";}.fa-share-alt:before{content:\"\\f1e0\";}.fa-share-alt-square:before{content:\"\\f1e1\";}.fa-bomb:before{content:\"\\f1e2\";}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:\"\\f1e3\";}.fa-tty:before{content:\"\\f1e4\";}.fa-binoculars:before{content:\"\\f1e5\";}.fa-plug:before{content:\"\\f1e6\";}.fa-slideshare:before{content:\"\\f1e7\";}.fa-twitch:before{content:\"\\f1e8\";}.fa-yelp:before{content:\"\\f1e9\";}.fa-newspaper-o:before{content:\"\\f1ea\";}.fa-wifi:before{content:\"\\f1eb\";}.fa-calculator:before{content:\"\\f1ec\";}.fa-paypal:before{content:\"\\f1ed\";}.fa-google-wallet:before{content:\"\\f1ee\";}.fa-cc-visa:before{content:\"\\f1f0\";}.fa-cc-mastercard:before{content:\"\\f1f1\";}.fa-cc-discover:before{content:\"\\f1f2\";}.fa-cc-amex:before{content:\"\\f1f3\";}.fa-cc-paypal:before{content:\"\\f1f4\";}.fa-cc-stripe:before{content:\"\\f1f5\";}.fa-bell-slash:before{content:\"\\f1f6\";}.fa-bell-slash-o:before{content:\"\\f1f7\";}.fa-trash:before{content:\"\\f1f8\";}.fa-copyright:before{content:\"\\f1f9\";}.fa-at:before{content:\"\\f1fa\";}.fa-eyedropper:before{content:\"\\f1fb\";}.fa-paint-brush:before{content:\"\\f1fc\";}.fa-birthday-cake:before{content:\"\\f1fd\";}.fa-area-chart:before{content:\"\\f1fe\";}.fa-pie-chart:before{content:\"\\f200\";}.fa-line-chart:before{content:\"\\f201\";}.fa-lastfm:before{content:\"\\f202\";}.fa-lastfm-square:before{content:\"\\f203\";}.fa-toggle-off:before{content:\"\\f204\";}.fa-toggle-on:before{content:\"\\f205\";}.fa-bicycle:before{content:\"\\f206\";}.fa-bus:before{content:\"\\f207\";}.fa-ioxhost:before{content:\"\\f208\";}.fa-angellist:before{content:\"\\f209\";}.fa-cc:before{content:\"\\f20a\";}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:\"\\f20b\";}.fa-meanpath:before{content:\"\\f20c\";}.fa-buysellads:before{content:\"\\f20d\";}.fa-connectdevelop:before{content:\"\\f20e\";}.fa-dashcube:before{content:\"\\f210\";}.fa-forumbee:before{content:\"\\f211\";}.fa-leanpub:before{content:\"\\f212\";}.fa-sellsy:before{content:\"\\f213\";}.fa-shirtsinbulk:before{content:\"\\f214\";}.fa-simplybuilt:before{content:\"\\f215\";}.fa-skyatlas:before{content:\"\\f216\";}.fa-cart-plus:before{content:\"\\f217\";}.fa-cart-arrow-down:before{content:\"\\f218\";}.fa-diamond:before{content:\"\\f219\";}.fa-ship:before{content:\"\\f21a\";}.fa-user-secret:before{content:\"\\f21b\";}.fa-motorcycle:before{content:\"\\f21c\";}.fa-street-view:before{content:\"\\f21d\";}.fa-heartbeat:before{content:\"\\f21e\";}.fa-venus:before{content:\"\\f221\";}.fa-mars:before{content:\"\\f222\";}.fa-mercury:before{content:\"\\f223\";}.fa-transgender:before{content:\"\\f224\";}.fa-transgender-alt:before{content:\"\\f225\";}.fa-venus-double:before{content:\"\\f226\";}.fa-mars-double:before{content:\"\\f227\";}.fa-venus-mars:before{content:\"\\f228\";}.fa-mars-stroke:before{content:\"\\f229\";}.fa-mars-stroke-v:before{content:\"\\f22a\";}.fa-mars-stroke-h:before{content:\"\\f22b\";}.fa-neuter:before{content:\"\\f22c\";}.fa-facebook-official:before{content:\"\\f230\";}.fa-pinterest-p:before{content:\"\\f231\";}.fa-whatsapp:before{content:\"\\f232\";}.fa-server:before{content:\"\\f233\";}.fa-user-plus:before{content:\"\\f234\";}.fa-user-times:before{content:\"\\f235\";}.fa-hotel:before,.fa-bed:before{content:\"\\f236\";}.fa-viacoin:before{content:\"\\f237\";}.fa-train:before{content:\"\\f238\";}.fa-subway:before{content:\"\\f239\";}.fa-medium:before{content:\"\\f23a\";}@font-face{font-family:'editormd-logo';src:url(\"editormdfonts/editormd-logo.eot?-5y8q6h\");src:url(\"editormdfonts/editormd-logo.eot?#iefix-5y8q6h\") format(\"embedded-opentype\"),url(\"editormdfonts/editormd-logo.woff?-5y8q6h\") format(\"woff\"),url(\"editormdfonts/editormd-logo.ttf?-5y8q6h\") format(\"truetype\"),url(\"editormdfonts/editormd-logo.svg?-5y8q6h#icomoon\") format(\"svg\");font-weight:normal;font-style:normal;}.editormd-logo,.editormd-logo-1x,.editormd-logo-2x,.editormd-logo-3x,.editormd-logo-4x,.editormd-logo-5x,.editormd-logo-6x,.editormd-logo-7x,.editormd-logo-8x{font-family:'editormd-logo';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;font-size:inherit;line-height:1;display:inline-block;text-rendering:auto;vertical-align:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}.editormd-logo:before,.editormd-logo-1x:before,.editormd-logo-2x:before,.editormd-logo-3x:before,.editormd-logo-4x:before,.editormd-logo-5x:before,.editormd-logo-6x:before,.editormd-logo-7x:before,.editormd-logo-8x:before{content:\"\\e1987\";}.editormd-logo-1x{font-size:1em;}.editormd-logo-lg{font-size:1.2em;}.editormd-logo-2x{font-size:2em;}.editormd-logo-3x{font-size:3em;}.editormd-logo-4x{font-size:4em;}.editormd-logo-5x{font-size:5em;}.editormd-logo-6x{font-size:6em;}.editormd-logo-7x{font-size:7em;}.editormd-logo-8x{font-size:8em;}.editormd-logo-color{color:#2196F3;}@font-face{font-family:octicons-anchor;src:url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAYcAA0AAAAACjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca8vGTk9TLzIAAAFMAAAARAAAAFZG1VHVY21hcAAAAZAAAAA+AAABQgAP9AdjdnQgAAAB0AAAAAQAAAAEACICiGdhc3AAAAHUAAAACAAAAAj//wADZ2x5ZgAAAdwAAADRAAABEKyikaNoZWFkAAACsAAAAC0AAAA2AtXoA2hoZWEAAALgAAAAHAAAACQHngNFaG10eAAAAvwAAAAQAAAAEAwAACJsb2NhAAADDAAAAAoAAAAKALIAVG1heHAAAAMYAAAAHwAAACABEAB2bmFtZQAAAzgAAALBAAAFu3I9x/Nwb3N0AAAF/AAAAB0AAAAvaoFvbwAAAAEAAAAAzBdyYwAAAADP2IQvAAAAAM/bz7t4nGNgZGFgnMDAysDB1Ml0hoGBoR9CM75mMGLkYGBgYmBlZsAKAtJcUxgcPsR8iGF2+O/AEMPsznAYKMwIkgMA5REMOXicY2BgYGaAYBkGRgYQsAHyGMF8FgYFIM0ChED+h5j//yEk/3KoSgZGNgYYk4GRCUgwMaACRoZhDwCs7QgGAAAAIgKIAAAAAf//AAJ4nHWMMQrCQBBF/0zWrCCIKUQsTDCL2EXMohYGSSmorScInsRGL2DOYJe0Ntp7BK+gJ1BxF1stZvjz/v8DRghQzEc4kIgKwiAppcA9LtzKLSkdNhKFY3HF4lK69ExKslx7Xa+vPRVS43G98vG1DnkDMIBUgFN0MDXflU8tbaZOUkXUH0+U27RoRpOIyCKjbMCVejwypzJJG4jIwb43rfl6wbwanocrJm9XFYfskuVC5K/TPyczNU7b84CXcbxks1Un6H6tLH9vf2LRnn8Ax7A5WQAAAHicY2BkYGAA4teL1+yI57f5ysDNwgAC529f0kOmWRiYVgEpDgYmEA8AUzEKsQAAAHicY2BkYGB2+O/AEMPCAAJAkpEBFbAAADgKAe0EAAAiAAAAAAQAAAAEAAAAAAAAKgAqACoAiAAAeJxjYGRgYGBhsGFgYgABEMkFhAwM/xn0QAIAD6YBhwB4nI1Ty07cMBS9QwKlQapQW3VXySvEqDCZGbGaHULiIQ1FKgjWMxknMfLEke2A+IJu+wntrt/QbVf9gG75jK577Lg8K1qQPCfnnnt8fX1NRC/pmjrk/zprC+8D7tBy9DHgBXoWfQ44Av8t4Bj4Z8CLtBL9CniJluPXASf0Lm4CXqFX8Q84dOLnMB17N4c7tBo1AS/Qi+hTwBH4rwHHwN8DXqQ30XXAS7QaLwSc0Gn8NuAVWou/gFmnjLrEaEh9GmDdDGgL3B4JsrRPDU2hTOiMSuJUIdKQQayiAth69r6akSSFqIJuA19TrzCIaY8sIoxyrNIrL//pw7A2iMygkX5vDj+G+kuoLdX4GlGK/8Lnlz6/h9MpmoO9rafrz7ILXEHHaAx95s9lsI7AHNMBWEZHULnfAXwG9/ZqdzLI08iuwRloXE8kfhXYAvE23+23DU3t626rbs8/8adv+9DWknsHp3E17oCf+Z48rvEQNZ78paYM38qfk3v/u3l3u3GXN2Dmvmvpf1Srwk3pB/VSsp512bA/GG5i2WJ7wu430yQ5K3nFGiOqgtmSB5pJVSizwaacmUZzZhXLlZTq8qGGFY2YcSkqbth6aW1tRmlaCFs2016m5qn36SbJrqosG4uMV4aP2PHBmB3tjtmgN2izkGQyLWprekbIntJFing32a5rKWCN/SdSoga45EJykyQ7asZvHQ8PTm6cslIpwyeyjbVltNikc2HTR7YKh9LBl9DADC0U/jLcBZDKrMhUBfQBvXRzLtFtjU9eNHKin0x5InTqb8lNpfKv1s1xHzTXRqgKzek/mb7nB8RZTCDhGEX3kK/8Q75AmUM/eLkfA+0Hi908Kx4eNsMgudg5GLdRD7a84npi+YxNr5i5KIbW5izXas7cHXIMAau1OueZhfj+cOcP3P8MNIWLyYOBuxL6DRylJ4cAAAB4nGNgYoAALjDJyIAOWMCiTIxMLDmZedkABtIBygAAAA==) format(\"woff\");}.markdown-body{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;color:#333;overflow:hidden;font-family:\"Microsoft YaHei\",Helvetica,\"Meiryo UI\",\"Malgun Gothic\",\"Segoe UI\",\"Trebuchet MS\",\"Monaco\",monospace,Tahoma,STXihei,\"华文细黑\",STHeiti,\"Helvetica Neue\",\"Droid Sans\",\"wenquanyi micro hei\",FreeSans,Arimo,Arial,SimSun,\"宋体\",Heiti,\"黑体\",sans-serif;font-size:16px;line-height:1.6;word-wrap:break-word;}.markdown-body a{background:transparent;}.markdown-body a:active,.markdown-body a:hover{outline:0;}.markdown-body strong{font-weight:bold;}.markdown-body h1{font-size:2em;margin:0.67em 0;}.markdown-body img{border:0;}.markdown-body hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}.markdown-body pre{overflow:auto;}.markdown-body code,.markdown-body kbd,.markdown-body pre{font-family:\"Meiryo UI\",\"YaHei Consolas Hybrid\",Consolas,\"Malgun Gothic\",\"Segoe UI\",\"Trebuchet MS\",Helvetica,monospace,monospace;font-size:1em;}.markdown-body input{color:inherit;font:inherit;margin:0;}.markdown-body html input[disabled]{cursor:default;}.markdown-body input{line-height:normal;}.markdown-body input[type=\"checkbox\"]{-moz-box-sizing:border-box;box-sizing:border-box;padding:0;}.markdown-body table{border-collapse:collapse;border-spacing:0;}.markdown-body td,.markdown-body th{padding:0;}.markdown-body *{-moz-box-sizing:border-box;box-sizing:border-box;}.markdown-body input{font:13px/1.4 Helvetica,arial,freesans,clean,sans-serif,\"Segoe UI Emoji\",\"Segoe UI Symbol\";}.markdown-body a{color:#4183c4;text-decoration:none;}.markdown-body a:hover,.markdown-body a:active{text-decoration:underline;}.markdown-body hr{height:0;margin:15px 0;overflow:hidden;background:transparent;border:0;border-bottom:1px solid #ddd;}.markdown-body hr:before{display:table;content:\"\";}.markdown-body hr:after{display:table;clear:both;content:\"\";}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:15px;margin-bottom:15px;line-height:1.1;}.markdown-body h1{font-size:30px;}.markdown-body h2{font-size:21px;}.markdown-body h3{font-size:16px;}.markdown-body h4{font-size:14px;}.markdown-body h5{font-size:12px;}.markdown-body h6{font-size:11px;}.markdown-body blockquote{margin:0;}.markdown-body ul,.markdown-body ol{padding:0;margin-top:0;margin-bottom:0;}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman;}.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol{list-style-type:lower-alpha;}.markdown-body dd{margin-left:0;}.markdown-body code{font-family:Consolas,\"Liberation Mono\",Menlo,Courier,monospace;font-size:12px;}.markdown-body pre{margin-top:0;margin-bottom:0;font:12px Consolas,\"Liberation Mono\",Menlo,Courier,monospace;}.markdown-body .octicon{font:normal normal 16px octicons-anchor;line-height:1;display:inline-block;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.markdown-body .octicon-link:before{content:'\\f05c';}.markdown-body > *:first-child{margin-top:0 !important;}.markdown-body > *:last-child{margin-bottom:0 !important;}.markdown-body .anchor{position:absolute;top:0;left:0;display:block;padding-right:6px;padding-left:30px;margin-left:-30px;}.markdown-body .anchor:focus{outline:none;}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{position:relative;margin-top:1em;margin-bottom:16px;font-weight:bold;line-height:1.4;}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{display:none;color:#000;vertical-align:middle;}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{padding-left:8px;margin-left:-30px;text-decoration:none;}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{display:inline-block;}.markdown-body h1{padding-bottom:0.3em;font-size:2.25em;line-height:1.2;border-bottom:1px solid #eee;}.markdown-body h1 .anchor{line-height:1;}.markdown-body h2{padding-bottom:0.3em;font-size:1.75em;line-height:1.225;border-bottom:1px solid #eee;}.markdown-body h2 .anchor{line-height:1;}.markdown-body h3{font-size:1.5em;line-height:1.43;}.markdown-body h3 .anchor{line-height:1.2;}.markdown-body h4{font-size:1.25em;}.markdown-body h4 .anchor{line-height:1.2;}.markdown-body h5{font-size:1em;}.markdown-body h5 .anchor{line-height:1.1;}.markdown-body h6{font-size:1em;color:#777;}.markdown-body h6 .anchor{line-height:1.1;}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre{margin-top:0;margin-bottom:16px;}.markdown-body ul,.markdown-body ol{padding-left:2em;}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0;}.markdown-body li > p{margin-top:16px;}.markdown-body dl{padding:0;}.markdown-body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:bold;}.markdown-body dl dd{padding:0 16px;margin-bottom:16px;}.markdown-body blockquote{padding:0 15px;color:#2d2d2d;border-left:4px solid #ddd;}.markdown-body blockquote >:first-child{margin-top:0;}.markdown-body blockquote >:last-child{margin-bottom:0;}.markdown-body table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all;}.markdown-body table th{font-weight:bold;}.markdown-body table th,.markdown-body table td{padding:6px 13px;border:1px solid #ddd;}.markdown-body table tr{background-color:#fff;border-top:1px solid #ccc;}.markdown-body table tr:nth-child(2n){background-color:#f8f8f8;}.markdown-body img{max-width:100%;-moz-box-sizing:border-box;box-sizing:border-box;}.markdown-body code{padding:0;padding-top:0.2em;padding-bottom:0.2em;margin:0;font-size:85%;background-color:rgba(0,0,0,0.04);border-radius:3px;}.markdown-body code:before,.markdown-body code:after{letter-spacing:-0.2em;content:\"\\00a0\";}.markdown-body pre > code{padding:0;margin:0;font-size:100%;word-break:normal;white-space:pre;background:transparent;border:0;}.markdown-body .highlight{margin-bottom:16px;}.markdown-body .highlight pre,.markdown-body pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;border-radius:3px;}.markdown-body .highlight pre{margin-bottom:0;word-break:normal;}.markdown-body pre{word-wrap:normal;}.markdown-body pre code{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0;}.markdown-body pre code:before,.markdown-body pre code:after{content:normal;}.markdown-body kbd{display:inline-block;padding:3px 5px;font-size:11px;line-height:10px;color:#555;vertical-align:middle;background-color:#fcfcfc;border:solid 1px #ccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb;}.markdown-body .pl-c{color:#969896;}.markdown-body .pl-c1,.markdown-body .pl-mdh,.markdown-body .pl-mm,.markdown-body .pl-mp,.markdown-body .pl-mr,.markdown-body .pl-s1 .pl-v,.markdown-body .pl-s3,.markdown-body .pl-sc,.markdown-body .pl-sv{color:#0086b3;}.markdown-body .pl-e,.markdown-body .pl-en{color:#795da3;}.markdown-body .pl-s1 .pl-s2,.markdown-body .pl-smi,.markdown-body .pl-smp,.markdown-body .pl-stj,.markdown-body .pl-vo,.markdown-body .pl-vpf{color:#333;}.markdown-body .pl-ent{color:#63a35c;}.markdown-body .pl-k,.markdown-body .pl-s,.markdown-body .pl-st{color:#a71d5d;}.markdown-body .pl-pds,.markdown-body .pl-s1,.markdown-body .pl-s1 .pl-pse .pl-s2,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sra,.markdown-body .pl-sr .pl-sre,.markdown-body .pl-src{color:#df5000;}.markdown-body .pl-mo,.markdown-body .pl-v{color:#1d3e81;}.markdown-body .pl-id{color:#b52a1d;}.markdown-body .pl-ii{background-color:#b52a1d;color:#f8f8f8;}.markdown-body .pl-sr .pl-cce{color:#63a35c;font-weight:bold;}.markdown-body .pl-ml{color:#693a17;}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{color:#1d3e81;font-weight:bold;}.markdown-body .pl-mq{color:#008080;}.markdown-body .pl-mi{color:#333;font-style:italic;}.markdown-body .pl-mb{color:#333;font-weight:bold;}.markdown-body .pl-md,.markdown-body .pl-mdhf{background-color:#ffecec;color:#bd2c00;}.markdown-body .pl-mdht,.markdown-body .pl-mi1{background-color:#eaffea;color:#55a532;}.markdown-body .pl-mdr{color:#795da3;font-weight:bold;}.markdown-body kbd{display:inline-block;padding:3px 5px;font:11px Consolas,\"Liberation Mono\",Menlo,Courier,monospace;line-height:10px;color:#555;vertical-align:middle;background-color:#fcfcfc;border:solid 1px #ccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb;}.markdown-body .task-list-item{list-style-type:none;}.markdown-body .task-list-item + .task-list-item{margin-top:3px;}.markdown-body .task-list-item input{float:left;margin:0.3em 0 0.25em -1.6em;vertical-align:middle;}.markdown-body:checked + .radio-label{z-index:1;position:relative;border-color:#4183c4;}.editormd-preview-container,.editormd-html-preview{text-align:left;font-size:14px;line-height:1.6;padding:20px;overflow:auto;width:100%;background-color:#fff;}.editormd-preview-container blockquote,.editormd-html-preview blockquote{color:#2d2d2d;border-left:4px solid #ddd;padding-left:20px;margin-left:0;font-size:14px;font-style:italic;}.editormd-preview-container p code,.editormd-html-preview p code{margin-left:5px;margin-right:4px;}.editormd-preview-container abbr,.editormd-html-preview abbr{background:#ffffdd;}.editormd-preview-container hr,.editormd-html-preview hr{height:1px;border:none;border-top:1px solid #ddd;background:none;}.editormd-preview-container code,.editormd-html-preview code{border:1px solid #ddd;background:#f6f6f6;padding:3px;border-radius:3px;font-size:14px;}.editormd-preview-container pre,.editormd-html-preview pre{border:1px solid #ddd;background:#f6f6f6;padding:10px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;}.editormd-preview-container pre code,.editormd-html-preview pre code{padding:0;}.editormd-preview-container pre,.editormd-preview-container code,.editormd-preview-container kbd,.editormd-html-preview pre,.editormd-html-preview code,.editormd-html-preview kbd{font-family:\"YaHei Consolas Hybrid\",Consolas,\"Meiryo UI\",\"Malgun Gothic\",\"Segoe UI\",\"Trebuchet MS\",Helvetica,monospace,monospace;}.editormd-preview-container table thead tr,.editormd-html-preview table thead tr,thead tr{background-color:#F8F8F8;}.editormd-preview-container p.editormd-tex,.editormd-html-preview p.editormd-tex{text-align:center;}.editormd-preview-container span.editormd-tex,.editormd-html-preview span.editormd-tex{margin:0 5px;}.editormd-preview-container .emoji,.editormd-html-preview .emoji{width:24px;height:24px;}.editormd-preview-container .katex,.editormd-html-preview .katex{font-size:1.4em;}.editormd-preview-container .sequence-diagram,.editormd-preview-container .flowchart,.editormd-html-preview .sequence-diagram,.editormd-html-preview .flowchart{margin:0 auto;text-align:center;}.editormd-preview-container .sequence-diagram svg,.editormd-preview-container .flowchart svg,.editormd-html-preview .sequence-diagram svg,.editormd-html-preview .flowchart svg{margin:0 auto;}.editormd-preview-container .sequence-diagram text,.editormd-preview-container .flowchart text,.editormd-html-preview .sequence-diagram text,.editormd-html-preview .flowchart text{font-size:15px !important;font-family:\"YaHei Consolas Hybrid\",Consolas,\"Microsoft YaHei\",\"Malgun Gothic\",\"Segoe UI\",Helvetica,Arial !important;}.pln{color:#000;}@media screen{.str{color:#080;}.kwd{color:#008;}.com{color:#800;}.typ{color:#606;}.lit{color:#066;}.pun,.opn,.clo{color:#660;}.tag{color:#008;}.atn{color:#606;}.atv{color:#080;}.dec,.var{color:#606;}.fun{color:red;}}@media print,projection{.str{color:#060;}.kwd{color:#006;font-weight:bold;}.com{color:#600;font-style:italic;}.typ{color:#404;font-weight:bold;}.lit{color:#044;}.pun,.opn,.clo{color:#440;}.tag{color:#006;font-weight:bold;}.atn{color:#404;}.atv{color:#060;}}pre.prettyprint{padding:2px;border:1px solid #888;}ol.linenums{margin-top:0;margin-bottom:0;}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none;}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee;}.editormd-preview-container pre.prettyprint,.editormd-html-preview pre.prettyprint{padding:10px;border:1px solid #ddd;white-space:pre-wrap;word-wrap:break-word;}.editormd-preview-container ol.linenums,.editormd-html-preview ol.linenums{color:#999;padding-left:2.5em;}.editormd-preview-container ol.linenums li,.editormd-html-preview ol.linenums li{list-style-type:decimal;}.editormd-preview-container ol.linenums li code,.editormd-html-preview ol.linenums li code{border:none;background:none;padding:0;}.editormd-preview-container .editormd-toc-menu,.editormd-html-preview .editormd-toc-menu{margin:8px 0 12px 0;display:inline-block;}.editormd-preview-container .editormd-toc-menu > .markdown-toc,.editormd-html-preview .editormd-toc-menu > .markdown-toc{position:relative;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;border:1px solid #ddd;display:inline-block;font-size:1em;}.editormd-preview-container .editormd-toc-menu > .markdown-toc > ul,.editormd-html-preview .editormd-toc-menu > .markdown-toc > ul{width:160%;min-width:180px;position:absolute;left:-1px;top:-2px;z-index:100;padding:0 10px 10px;display:none;background:#fff;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 3px 5px rgba(0,0,0,0.2);-moz-box-shadow:0 3px 5px rgba(0,0,0,0.2);-ms-box-shadow:0 3px 5px rgba(0,0,0,0.2);-o-box-shadow:0 3px 5px rgba(0,0,0,0.2);box-shadow:0 3px 5px rgba(0,0,0,0.2);}.editormd-preview-container .editormd-toc-menu > .markdown-toc > ul > li ul,.editormd-html-preview .editormd-toc-menu > .markdown-toc > ul > li ul{width:100%;min-width:180px;border:1px solid #ddd;display:none;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px;}.editormd-preview-container .editormd-toc-menu > .markdown-toc > ul > li a,.editormd-html-preview .editormd-toc-menu > .markdown-toc > ul > li a{color:#666;padding:6px 10px;display:block;-webkit-transition:background-color 500ms ease-out;-moz-transition:background-color 500ms ease-out;transition:background-color 500ms ease-out;}.editormd-preview-container .editormd-toc-menu > .markdown-toc > ul > li a:hover,.editormd-html-preview .editormd-toc-menu > .markdown-toc > ul > li a:hover{background-color:#f6f6f6;}.editormd-preview-container .editormd-toc-menu > .markdown-toc li,.editormd-html-preview .editormd-toc-menu > .markdown-toc li{position:relative;}.editormd-preview-container .editormd-toc-menu > .markdown-toc li > ul,.editormd-html-preview .editormd-toc-menu > .markdown-toc li > ul{position:absolute;top:32px;left:10%;display:none;-webkit-box-shadow:0 3px 5px rgba(0,0,0,0.2);-moz-box-shadow:0 3px 5px rgba(0,0,0,0.2);-ms-box-shadow:0 3px 5px rgba(0,0,0,0.2);-o-box-shadow:0 3px 5px rgba(0,0,0,0.2);box-shadow:0 3px 5px rgba(0,0,0,0.2);}.editormd-preview-container .editormd-toc-menu > .markdown-toc li > ul:before,.editormd-preview-container .editormd-toc-menu > .markdown-toc li > ul:after,.editormd-html-preview .editormd-toc-menu > .markdown-toc li > ul:before,.editormd-html-preview .editormd-toc-menu > .markdown-toc li > ul:after{pointer-events:pointer-events;position:absolute;left:15px;top:-6px;display:block;content:\"\";width:0;height:0;border:6px solid transparent;border-width:0 6px 6px;z-index:10;}.editormd-preview-container .editormd-toc-menu > .markdown-toc li > ul:before,.editormd-html-preview .editormd-toc-menu > .markdown-toc li > ul:before{border-bottom-color:#ccc;}.editormd-preview-container .editormd-toc-menu > .markdown-toc li > ul:after,.editormd-html-preview .editormd-toc-menu > .markdown-toc li > ul:after{border-bottom-color:#ffffff;top:-5px;}.editormd-preview-container .editormd-toc-menu ul,.editormd-html-preview .editormd-toc-menu ul{list-style:none;}.editormd-preview-container .editormd-toc-menu a,.editormd-html-preview .editormd-toc-menu a{text-decoration:none;}.editormd-preview-container .editormd-toc-menu h1,.editormd-html-preview .editormd-toc-menu h1{font-size:16px;padding:5px 0 10px 10px;line-height:1;border-bottom:1px solid #eee;}.editormd-preview-container .editormd-toc-menu h1 .fa,.editormd-html-preview .editormd-toc-menu h1 .fa{padding-left:10px;}.editormd-preview-container .editormd-toc-menu .toc-menu-btn,.editormd-html-preview .editormd-toc-menu .toc-menu-btn{color:#666;min-width:180px;padding:5px 10px;border-radius:4px;display:inline-block;-webkit-transition:background-color 500ms ease-out;-moz-transition:background-color 500ms ease-out;transition:background-color 500ms ease-out;}.editormd-preview-container .editormd-toc-menu .toc-menu-btn:hover,.editormd-html-preview .editormd-toc-menu .toc-menu-btn:hover{background-color:#f6f6f6;}.editormd-preview-container .editormd-toc-menu .toc-menu-btn .fa,.editormd-html-preview .editormd-toc-menu .toc-menu-btn .fa{float:right;padding:3px 0 0 10px;font-size:1.3em;}.markdown-body .editormd-toc-menu ul{padding-left:0;}.markdown-body .highlight pre,.markdown-body pre{line-height:1.6;}hr.editormd-page-break{border:1px dotted #ccc;font-size:0;height:2px;}@media only print{hr.editormd-page-break{background:none;border:none;height:0;}}.editormd-html-preview textarea{display:none;}.editormd-html-preview hr.editormd-page-break{background:none;border:none;height:0;}.editormd-preview-close-btn{color:#fff;padding:4px 6px;font-size:18px;-webkit-border-radius:500px;-moz-border-radius:500px;-ms-border-radius:500px;-o-border-radius:500px;border-radius:500px;display:none;background-color:#ccc;position:absolute;top:25px;right:35px;z-index:19;-webkit-transition:background-color 300ms ease-out;-moz-transition:background-color 300ms ease-out;transition:background-color 300ms ease-out;}.editormd-preview-close-btn:hover{background-color:#999;}.editormd-preview-active{width:100%;padding:40px;}.editormd-preview-theme-dark{color:#777;background:#2C2827;}.editormd-preview-theme-dark .editormd-preview-container{color:#888;background-color:#2C2827;}.editormd-preview-theme-dark .editormd-preview-container pre.prettyprint{border:none;}.editormd-preview-theme-dark .editormd-preview-container blockquote{color:#555;padding:0.5em;background:#222;border-color:#333;}.editormd-preview-theme-dark .editormd-preview-container abbr{color:#fff;padding:1px 3px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#ff9900;}.editormd-preview-theme-dark .editormd-preview-container code{color:#fff;border:none;padding:1px 3px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;background:#5A9600;}.editormd-preview-theme-dark .editormd-preview-container table{border:none;}.editormd-preview-theme-dark .editormd-preview-container .fa-emoji{color:#B4BF42;}.editormd-preview-theme-dark .editormd-preview-container .katex{color:#FEC93F;}.editormd-preview-theme-dark .editormd-toc-menu > .markdown-toc{background:#fff;border:none;}.editormd-preview-theme-dark .editormd-toc-menu > .markdown-toc h1{border-color:#ddd;}.editormd-preview-theme-dark .markdown-body h1,.editormd-preview-theme-dark .markdown-body h2,.editormd-preview-theme-dark .markdown-body hr{border-color:#222;}.editormd-preview-theme-dark pre{color:#999;background-color:#111;background-color:rgba(0,0,0,0.4);}.editormd-preview-theme-dark pre .pln{color:#999;}.editormd-preview-theme-dark li.L1,.editormd-preview-theme-dark li.L3,.editormd-preview-theme-dark li.L5,.editormd-preview-theme-dark li.L7,.editormd-preview-theme-dark li.L9{background:none;}.editormd-preview-theme-dark [class*=editormd-logo]{color:#2196F3;}.editormd-preview-theme-dark .sequence-diagram text{fill:#fff;}.editormd-preview-theme-dark .sequence-diagram rect,.editormd-preview-theme-dark .sequence-diagram path{color:#fff;fill:#64D1CB;stroke:#64D1CB;}.editormd-preview-theme-dark .flowchart rect,.editormd-preview-theme-dark .flowchart path{stroke:#A6C6FF;}.editormd-preview-theme-dark .flowchart rect{fill:#A6C6FF;}.editormd-preview-theme-dark .flowchart text{fill:#5879B4;}@media screen{.editormd-preview-theme-dark{}.editormd-preview-theme-dark .str{color:#080;}.editormd-preview-theme-dark .kwd{color:#ff9900;}.editormd-preview-theme-dark .com{color:#444444;}.editormd-preview-theme-dark .typ{color:#606;}.editormd-preview-theme-dark .lit{color:#066;}.editormd-preview-theme-dark .pun,.editormd-preview-theme-dark .opn,.editormd-preview-theme-dark .clo{color:#660;}.editormd-preview-theme-dark .tag{color:#ff9900;}.editormd-preview-theme-dark .atn{color:#6C95F5;}.editormd-preview-theme-dark .atv{color:#080;}.editormd-preview-theme-dark .dec,.editormd-preview-theme-dark .var{color:#008BA7;}.editormd-preview-theme-dark .fun{color:red;}}.editormd-onlyread .editormd-toolbar{display:none;}.editormd-onlyread .CodeMirror{margin-top:0;}.editormd-onlyread .editormd-preview{top:0;}.editormd-fullscreen{position:fixed;top:0;left:0;border:none;z-index:2;margin:0 auto;}.editormd-theme-dark{border-color:#1a1a17;}.editormd-theme-dark .editormd-toolbar{background:#1A1A17;border-color:#1a1a17;}.editormd-theme-dark .editormd-menu > li > a{color:#777;border-color:#1a1a17;}.editormd-theme-dark .editormd-menu > li > a:hover,.editormd-theme-dark .editormd-menu > li > a.active{border-color:#333;background:#333;}.editormd-theme-dark .editormd-menu > li.divider{border-right:1px solid #111;}.editormd-theme-dark .CodeMirror{border-right:1px solid rgba(0,0,0,0.1);}tr{background:#f8f8f8;}</style>";
		String headTwo = "<body><div class=\"markdown-body editormd-preview-container\">";

		String foot = "</div></body></html>";
		//读取yxj的css文件
		String filePathCss = request.getSession().getServletContext().getRealPath("pc/css/extends/katex.min.css");
		String cssStrTwo = readToString(filePathCss);
		cssStrTwo = "<style>"+cssStrTwo+"</style>";
		try {
			String newStr = head+cssStr+cssStrTwo+headTwo+html+foot;
			StringBuilder sb = new StringBuilder(newStr);
			PrintStream printStream = null ;
			printStream= new PrintStream(new FileOutputStream(filePath));//路径默认在项目根目录下
			printStream.println(sb.toString());
			File f = new File(filePath);
			printStream.close();
		}catch (Exception e){
			e.printStackTrace();
		}
	}

	/***
	 * param:width、height、url(图片路径)
	 * 判断当前图片的高和宽是否符合要求并且进行压缩
	 */
	public static boolean compressImage(double width, double height, File url) throws IOException {
		if(height<52){
			//说明上传的图片大小符合规则，不需要进行压缩
			return true;
		}
		//将高给为52，则对应的长度为
	/*	double finalWidth = (52*width)/height;
		finalWidth = (double)Math.round(finalWidth*100)/100;*///保留两位小数
		//开始按高进行压缩
		Thumbnails.Builder<File> builder = Thumbnails.of(url);
		builder.height(52).toFile(url);//按高度进行压缩
		//按高度压缩后在查询压缩后的图片宽
		double widthThree = ImageTools.getImgWidth(url);
		if(widthThree<260){
			//说明这个压缩比例符合，可以直接返回
			return true;
		}
		//说明按高压缩完后，宽度不符合，则开始按宽度进行压缩
		//将宽给260，对应的高度应该为
		/*double finalHeight =(260*height)/width;
		finalHeight = (double)Math.round(finalHeight*100)/100;*///保留两位小数
		builder.width(260).toFile(url);
		return true;
	}

	/**
	 * 读取文件内容
	 */
	public static String readToString(String filePath) {
		String encoding = "UTF-8";
		File file = new File(filePath);
		Long filelength = file.length();
		byte[] filecontent = new byte[filelength.intValue()];
		try {
			FileInputStream in = new FileInputStream(file);
			in.read(filecontent);
			in.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		try {
			return new String(filecontent, encoding);
		} catch (UnsupportedEncodingException e) {
			System.err.println("The OS does not support " + encoding);
			e.printStackTrace();
			return null;
		}
	}

	/**
	 * @Description: 将base64编码字符串转换为图片
	 * @Author:
	 * @CreateTime:
	 * @param imgStr base64编码字符串
	 * @param path 图片路径-具体到文件
	 * @return
	 */
	public static boolean generateImage(String imgStr, String path) {
		if (imgStr == null)
			return false;
		BASE64Decoder decoder = new BASE64Decoder();
		try {
			// 解密
			byte[] b = decoder.decodeBuffer(imgStr);
			// 处理数据
			for (int i = 0; i < b.length; ++i) {
				if (b[i] < 0) {
					b[i] += 256;
				}
			}
			OutputStream out = new FileOutputStream(path);
			out.write(b);
			out.flush();
			out.close();
			return true;
		} catch (Exception e) {
			return false;
		}
	}

}



